mirror of
https://github.com/containers/podman.git
synced 2025-05-21 17:16:22 +08:00
podman-remote ps
add the ability to run ps on containers using the remote client. Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
@ -401,6 +401,29 @@ func (t ContainerStatus) String() string {
|
||||
return "bad state"
|
||||
}
|
||||
|
||||
// StringToContainerStatus converts a string representation of a containers
|
||||
// status into an actual container status type
|
||||
func StringToContainerStatus(status string) (ContainerStatus, error) {
|
||||
switch status {
|
||||
case ContainerStateUnknown.String():
|
||||
return ContainerStateUnknown, nil
|
||||
case ContainerStateConfigured.String():
|
||||
return ContainerStateConfigured, nil
|
||||
case ContainerStateCreated.String():
|
||||
return ContainerStateCreated, nil
|
||||
case ContainerStateRunning.String():
|
||||
return ContainerStateRunning, nil
|
||||
case ContainerStateStopped.String():
|
||||
return ContainerStateStopped, nil
|
||||
case ContainerStatePaused.String():
|
||||
return ContainerStatePaused, nil
|
||||
case ContainerStateExited.String():
|
||||
return ContainerStateExited, nil
|
||||
default:
|
||||
return ContainerStateUnknown, errors.Wrapf(ErrInvalidArg, "unknown container state: %s", status)
|
||||
}
|
||||
}
|
||||
|
||||
// Config accessors
|
||||
// Unlocked
|
||||
|
||||
|
Reference in New Issue
Block a user