mirror of
https://github.com/containers/podman.git
synced 2025-10-17 19:24:04 +08:00
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>
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user