diff options
author | Matthew Heon <matthew.heon@pm.me> | 2019-04-01 19:45:23 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2019-05-03 10:36:16 -0400 |
commit | 7ba1b609aad678f458951c978455ea44c5b4d3ec (patch) | |
tree | cd9b6322c44fbb15579ff40f3ca33ea8d63285a1 /libpod/container.go | |
parent | 357e4c37e92e7426a66f1a1142a9650bb0d81ca0 (diff) | |
download | podman-7ba1b609aad678f458951c978455ea44c5b4d3ec.tar.gz podman-7ba1b609aad678f458951c978455ea44c5b4d3ec.tar.bz2 podman-7ba1b609aad678f458951c978455ea44c5b4d3ec.zip |
Move to using constants for valid restart policy types
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/container.go')
-rw-r--r-- | libpod/container.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libpod/container.go b/libpod/container.go index 769c4f69c..c07f4c78d 100644 --- a/libpod/container.go +++ b/libpod/container.go @@ -102,6 +102,20 @@ func (ns LinuxNS) String() string { } } +// Valid restart policy types. +const ( + // RestartPolicyNone indicates that no restart policy has been requested + // by a container. + RestartPolicyNone = "" + // RestartPolicyNo is identical in function to RestartPolicyNone. + RestartPolicyNo = "no" + // RestartPolicyAlways unconditionally restarts the container. + RestartPolicyAlways = "always" + // RestartPolicyOnFailure restarts the container on non-0 exit code, + // with an optional maximum number of retries. + RestartPolicyOnFailure = "on-failure" +) + // Container is a single OCI container. // All operations on a Container that access state must begin with a call to // syncContainer(). |