aboutsummaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorUrvashi Mohnani <umohnani@redhat.com>2022-07-19 11:58:27 -0400
committerUrvashi Mohnani <umohnani@redhat.com>2022-07-20 10:02:32 -0400
commitda33f100551ebd9b5e8790d677a1a8be2ea4fae4 (patch)
treedaebdd87c3056614f7f74545db2fe392cf95371b /pkg
parent21cf30f2f895a3c453760f800077b8f7dbfce23c (diff)
downloadpodman-da33f100551ebd9b5e8790d677a1a8be2ea4fae4.tar.gz
podman-da33f100551ebd9b5e8790d677a1a8be2ea4fae4.tar.bz2
podman-da33f100551ebd9b5e8790d677a1a8be2ea4fae4.zip
Update init ctr default for play kube
Update the init container type default to once instead of always to match k8s behavior. Add a new annotation that can be used to change the init ctr type in the kube yaml. Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
Diffstat (limited to 'pkg')
-rw-r--r--pkg/domain/infra/abi/play.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go
index c913fdb69..8b47eff53 100644
--- a/pkg/domain/infra/abi/play.go
+++ b/pkg/domain/infra/abi/play.go
@@ -507,13 +507,17 @@ func (ic *ContainerEngine) playKubePod(ctx context.Context, podName string, podY
for k, v := range podSpec.PodSpecGen.Labels { // add podYAML labels
labels[k] = v
}
+ initCtrType := annotations[define.InitContainerType]
+ if initCtrType == "" {
+ initCtrType = define.OneShotInitContainer
+ }
specgenOpts := kube.CtrSpecGenOptions{
Annotations: annotations,
ConfigMaps: configMaps,
Container: initCtr,
Image: pulledImage,
- InitContainerType: define.AlwaysInitContainer,
+ InitContainerType: initCtrType,
Labels: labels,
LogDriver: options.LogDriver,
LogOptions: options.LogOptions,