mirror of
https://github.com/cirruslabs/orchard.git
synced 2026-10-22 06:18:16 +02:00
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:
+1
-1
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user