mirror of
https://github.com/cirruslabs/orchard.git
synced 2026-09-30 03:51:43 +02:00
Try "tart ip --resolver=agent" first when using "--net-bridged" (#323)
This commit is contained in:
@@ -360,6 +360,16 @@ func (vm *VM) run(ctx context.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (vm *VM) IP(ctx context.Context) (string, error) {
|
func (vm *VM) IP(ctx context.Context) (string, error) {
|
||||||
|
// Bridged networking is problematic, so try with
|
||||||
|
// the agent resolver first using a small timeout
|
||||||
|
if vm.Resource.NetBridged != "" {
|
||||||
|
stdout, _, err := tart.Tart(ctx, vm.logger, "ip", "--wait", "5",
|
||||||
|
"--resolver", "agent", vm.id())
|
||||||
|
if err == nil {
|
||||||
|
return strings.TrimSpace(stdout), nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
args := []string{"ip", "--wait", "60"}
|
args := []string{"ip", "--wait", "60"}
|
||||||
|
|
||||||
if vm.Resource.NetBridged != "" {
|
if vm.Resource.NetBridged != "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user