Support "tart run"'s --net-softnet-allow and --net-softnet-block (#361)

* Support "tart run"'s --net-softnet-allow and --net-softnet-block

* Use ghcr.io/cirruslabs/macos-tahoe-base:latest by default
This commit is contained in:
Nikolay Edigaryev
2025-10-27 23:07:43 +04:00
committed by GitHub
parent 8fed9f396c
commit 08e9dfbbfe
7 changed files with 87 additions and 26 deletions
+7 -1
View File
@@ -336,9 +336,15 @@ func (vm *VM) cloneAndConfigure(ctx context.Context) error {
func (vm *VM) run(ctx context.Context) error {
var runArgs = []string{"run"}
if vm.Resource.NetSoftnet {
if vm.Resource.NetSoftnetDeprecated || vm.Resource.NetSoftnet {
runArgs = append(runArgs, "--net-softnet")
}
if len(vm.Resource.NetSoftnetAllow) != 0 {
runArgs = append(runArgs, "--net-softnet-allow", strings.Join(vm.Resource.NetSoftnetAllow, ","))
}
if len(vm.Resource.NetSoftnetBlock) != 0 {
runArgs = append(runArgs, "--net-softnet-block", strings.Join(vm.Resource.NetSoftnetBlock, ","))
}
if vm.Resource.NetBridged != "" {
runArgs = append(runArgs, fmt.Sprintf("--net-bridged=%s", vm.Resource.NetBridged))
}