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
View File
@@ -43,6 +43,13 @@ func (controller *Controller) createVM(ctx *gin.Context) responder.Responder {
vm.RestartCount = 0
vm.UID = uuid.New().String()
// Softnet-specific logic: automatically enable Softnet when NetSoftnetAllow or NetSoftnetBlock are set
// and propagate deprecated and non-deprecated boolean fields into each other
if vm.NetSoftnetDeprecated || vm.NetSoftnet || len(vm.NetSoftnetAllow) != 0 || len(vm.NetSoftnetBlock) != 0 {
vm.NetSoftnetDeprecated = true
vm.NetSoftnet = true
}
// Provide resource defaults
if vm.Resources == nil {
vm.Resources = make(v1.Resources)