mirror of
https://github.com/containers/podman.git
synced 2025-06-07 15:48:37 +08:00

The init binary until now has been bind-mounted to /dev/init which breaks when bind-mounting to /dev. Instead mount the init to /run/podman-init. The reasoning for using /run is that it is already used for other runtime data such as secrets. Fixes: #14251 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
41 lines
1.5 KiB
Go
41 lines
1.5 KiB
Go
package define
|
|
|
|
// 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"
|
|
// RestartPolicyUnlessStopped unconditionally restarts unless stopped
|
|
// by the user. It is identical to Always except with respect to
|
|
// handling of system restart, which Podman does not yet support.
|
|
RestartPolicyUnlessStopped = "unless-stopped"
|
|
)
|
|
|
|
// RestartPolicyMap maps between restart-policy valid values to restart policy types
|
|
var RestartPolicyMap = map[string]string{
|
|
"none": RestartPolicyNone,
|
|
RestartPolicyNo: RestartPolicyNo,
|
|
RestartPolicyAlways: RestartPolicyAlways,
|
|
RestartPolicyOnFailure: RestartPolicyOnFailure,
|
|
RestartPolicyUnlessStopped: RestartPolicyUnlessStopped,
|
|
}
|
|
|
|
// InitContainerTypes
|
|
const (
|
|
// AlwaysInitContainer is an init container than runs on each
|
|
// pod start (including restart)
|
|
AlwaysInitContainer = "always"
|
|
// OneShotInitContainer is a container that only runs as init once
|
|
// and is then deleted.
|
|
OneShotInitContainer = "once"
|
|
// ContainerInitPath is the default path of the mounted container init.
|
|
ContainerInitPath = "/run/podman-init"
|
|
)
|