Skip to content

Commit

Permalink
start: Return error when failing to get IP
Browse files Browse the repository at this point in the history
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 crc-org/crc#2214
  • Loading branch information
cfergeau committed Apr 13, 2021
1 parent 35232ab commit 2e8b576
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/libvirt/libvirt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 2e8b576

Please sign in to comment.