diff options
author | Brent Baude <bbaude@redhat.com> | 2021-07-14 16:03:55 -0500 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2021-08-04 14:14:36 -0500 |
commit | 3c3fa6fac4d0f8e89181ea2d4e1fe0318d24b6f4 (patch) | |
tree | f087d0a772797a9028df514d8d0369835724b3a2 /libpod/container_graph.go | |
parent | e93661f5e765d84893e2ad5a488682c0a67412d0 (diff) | |
download | podman-3c3fa6fac4d0f8e89181ea2d4e1fe0318d24b6f4.tar.gz podman-3c3fa6fac4d0f8e89181ea2d4e1fe0318d24b6f4.tar.bz2 podman-3c3fa6fac4d0f8e89181ea2d4e1fe0318d24b6f4.zip |
implement init containers in podman
this is the first pass at implementing init containers for podman pods.
init containersare made popular by k8s as a way to run setup for pods
before the pods standard containers run.
unlike k8s, we support two styles of init containers: always and
oneshot. always means the container stays in the pod and starts
whenever a pod is started. this does not apply to pods restarting.
oneshot means the container runs onetime when the pod starts and then is
removed.
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'libpod/container_graph.go')
-rw-r--r-- | libpod/container_graph.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/container_graph.go b/libpod/container_graph.go index 3ae7cfbc7..32fb264f1 100644 --- a/libpod/container_graph.go +++ b/libpod/container_graph.go @@ -259,7 +259,7 @@ func startNode(ctx context.Context, node *containerNode, setError bool, ctrError } // Start the container (only if it is not running) - if !ctrErrored { + if !ctrErrored && len(node.container.config.InitContainerType) < 1 { if !restart && node.container.state.State != define.ContainerStateRunning { if err := node.container.initAndStart(ctx); err != nil { ctrErrored = true |