Fix Tart VM IP detection in bridged mode (#124)

This commit is contained in:
Nikolay Edigaryev
2023-09-12 08:52:21 +00:00
committed by GitHub
parent 036eb954be
commit bb3d6edcd5
+9 -1
View File
@@ -172,7 +172,15 @@ func (vm *VM) run(ctx context.Context) error {
}
func (vm *VM) IP(ctx context.Context) (string, error) {
stdout, _, err := tart.Tart(ctx, vm.logger, "ip", "--wait", "60", vm.id())
args := []string{"ip", "--wait", "60"}
if vm.Resource.NetBridged != "" {
args = append(args, "--resolver", "arp")
}
args = append(args, vm.id())
stdout, _, err := tart.Tart(ctx, vm.logger, args...)
if err != nil {
return "", err
}