From 2e8b5765e8964f1f3293c66f40f53f0f988c4ba3 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Tue, 13 Apr 2021 14:39:53 +0200 Subject: [PATCH] start: Return error when failing to get IP At the moment, nil is returned when Start() fails to gets the VM IP crc's code assumes that when Start() returns, the VM has an IP. This should help catch this situation. This is related to https://github.com/code-ready/crc/issues/2214 --- pkg/libvirt/libvirt.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/libvirt/libvirt.go b/pkg/libvirt/libvirt.go index 04fcca22..99d35aa6 100644 --- a/pkg/libvirt/libvirt.go +++ b/pkg/libvirt/libvirt.go @@ -400,6 +400,7 @@ func (d *Driver) Start() error { if d.IPAddress == "" { log.Warnf("Unable to determine VM's IP address, did it fail to boot?") + return fmt.Errorf("Unable to determine VM's IP address, did it fail to boot?") } return nil }