Randomize the VM's MAC-address when using bridged networking (#182)

* Randomize the VM's MAC-address when using bridged networking

* CI: bypass test caching for "go test"
This commit is contained in:
Nikolay Edigaryev
2024-06-18 11:19:56 +04:00
committed by GitHub
parent 772654a408
commit 9442b6c5c3
2 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ task:
pull_script:
- tart pull ghcr.io/cirruslabs/macos-sonoma-base:latest
test_script:
- go test -v ./...
- go test -v -count=1 ./...
always:
cleanup_script:
- tart list
+12
View File
@@ -200,6 +200,18 @@ func (vm *VM) cloneAndConfigure(ctx context.Context) error {
return err
}
}
// Randomize the VM's MAC-address when using bridged networking
// to avoid collisions when cloning from an OCI image on multiple hosts
//
// See https://github.com/cirruslabs/orchard/issues/181 for more details.
if vm.Resource.NetBridged != "" {
_, _, err = tart.Tart(ctx, vm.logger, "set", "--random-mac")
if err != nil {
return err
}
}
return nil
}