Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show starting state when machine is starting #14742

Merged
merged 1 commit into from
Jun 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions pkg/machine/qemu/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,7 @@ func getVMInfos() ([]*machine.ListResponse, error) {
listEntry.RemoteUsername = vm.RemoteUsername
listEntry.IdentityPath = vm.IdentityPath
listEntry.CreatedAt = vm.Created
listEntry.Starting = vm.Starting

if listEntry.CreatedAt.IsZero() {
listEntry.CreatedAt = time.Now()
Expand All @@ -1087,6 +1088,7 @@ func getVMInfos() ([]*machine.ListResponse, error) {
if err != nil {
return err
}
listEntry.Running = state == machine.Running

if !vm.LastUp.IsZero() { // this means we have already written a time to the config
listEntry.LastUp = vm.LastUp
Expand All @@ -1097,12 +1099,6 @@ func getVMInfos() ([]*machine.ListResponse, error) {
return err
}
}
switch state {
case machine.Running:
listEntry.Running = true
case machine.Starting:
listEntry.Starting = true
}

listed = append(listed, listEntry)
}
Expand Down