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

This commit is contained in:
Nikolay Edigaryev 2023-09-12 12:52:21 +04:00 committed by GitHub
parent 036eb954be
commit bb3d6edcd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

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
}