From 7ba1b609aad678f458951c978455ea44c5b4d3ec Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Mon, 1 Apr 2019 19:45:23 -0400 Subject: Move to using constants for valid restart policy types Signed-off-by: Matthew Heon --- libpod/container.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libpod/container.go') 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(). -- cgit v1.2.3-54-g00ecf