diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-01-18 06:22:05 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-18 06:22:05 -0500 |
commit | d6b0720b9cd5d993dffc229e73d8377aae2c2ed4 (patch) | |
tree | a0efd9dff39774597d87c98dbe089b57af77c726 /libpod/define | |
parent | d0eb24bae0023848447568d024acdaadb632edfe (diff) | |
parent | 141de86862898a4b9e35c15f51031952c63c7114 (diff) | |
download | podman-d6b0720b9cd5d993dffc229e73d8377aae2c2ed4.tar.gz podman-d6b0720b9cd5d993dffc229e73d8377aae2c2ed4.tar.bz2 podman-d6b0720b9cd5d993dffc229e73d8377aae2c2ed4.zip |
Merge pull request #12684 from mheon/remap_states
Revamp Libpod state strings for Docker compat
Diffstat (limited to 'libpod/define')
-rw-r--r-- | libpod/define/containerstate.go | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/libpod/define/containerstate.go b/libpod/define/containerstate.go index fc272beaa..23ba1f451 100644 --- a/libpod/define/containerstate.go +++ b/libpod/define/containerstate.go @@ -37,16 +37,23 @@ const ( ContainerStateStopping ContainerStatus = iota ) -// ContainerStatus returns a string representation for users -// of a container state +// ContainerStatus returns a string representation for users of a container +// state. All results should match Docker's versions (from `docker ps`) as +// closely as possible, given the different set of states we support. func (t ContainerStatus) String() string { switch t { case ContainerStateUnknown: return "unknown" case ContainerStateConfigured: - return "configured" - case ContainerStateCreated: + // The naming here is confusing, but it's necessary for Docker + // compatibility - their Created state is our Configured state. return "created" + case ContainerStateCreated: + // Docker does not have an equivalent to this state, so give it + // a clear name. Most of the time this is a purely transitory + // state between Configured and Running so we don't expect to + // see it much anyways. + return "initialized" case ContainerStateRunning: return "running" case ContainerStateStopped: |