Skip to content

Commit

Permalink
workaround(?) crash on GetState
Browse files Browse the repository at this point in the history
Needs a closer look, was crashing because we were calling into podman
which expects a non-nil vmconfig. Haven't looked if the problem was with the
serialization/deserialization of the machine driver, or if it's expected
to have a nil vmconfig in certain situations.
  • Loading branch information
cfergeau committed Aug 1, 2024
1 parent 9ddbd83 commit 44da672
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/machinedriver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,9 @@ func podmanStatusToCrcState(status define.Status) state.State {

// GetState returns the state that the host is in (running, stopped, etc)
func (d *Driver) GetState() (state.State, error) {
if d.vmConfig == nil {
return state.Stopped, nil
}
status, err := d.vmProvider.State(d.vmConfig, false)
if err != nil {
return state.Error, err
Expand Down

0 comments on commit 44da672

Please sign in to comment.