Skip to content

Commit

Permalink
machine.Stop returns the current state of the VM
Browse files Browse the repository at this point in the history
It should not return the status before stopping the VM.
  • Loading branch information
guillaumerose committed Nov 9, 2020
1 parent 5635614 commit d8d3999
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/crc/machine/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,13 +485,11 @@ func (client *client) Stop() (state.State, error) {
return state.None, errors.Wrap(err, "Cannot load machine")
}

// FIXME: Why is the state fetched before calling host.Stop() ? We will return state.Running most of the time instead of state.Stopped
vmState, _ := host.Driver.GetState()
logging.Info("Stopping the OpenShift cluster, this may take a few minutes...")
if err := host.Stop(); err != nil {
return state.None, errors.Wrap(err, "Cannot stop machine")
}
return vmState, nil
return host.Driver.GetState()
}

func (client *client) PowerOff() error {
Expand Down

0 comments on commit d8d3999

Please sign in to comment.