Skip to content

Commit ee9abec

Browse files
nalindcevich
authored andcommitted
runUsingRuntime: use named constants for runtime states
Use the named constants for the status values that runtimes can report to us when we run them with the "state" command. Signed-off-by: Nalin Dahyabhai <[email protected]>
1 parent 4b8de2f commit ee9abec

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

run_common.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,8 +660,9 @@ func runUsingRuntime(options RunOptions, configureNetwork bool, moreCreateArgs [
660660
return 1, fmt.Errorf("parsing container state %q from %s: %w", string(stateOutput), runtime, err)
661661
}
662662
switch state.Status {
663-
case "running":
664-
case "stopped":
663+
case specs.StateCreating, specs.StateCreated, specs.StateRunning:
664+
// all fine
665+
case specs.StateStopped:
665666
atomic.StoreUint32(&stopped, 1)
666667
default:
667668
return 1, fmt.Errorf("container status unexpectedly changed to %q", state.Status)

0 commit comments

Comments
 (0)