summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorUrvashi Mohnani <umohnani@redhat.com>2022-07-19 11:58:27 -0400
committerMatthew Heon <matthew.heon@pm.me>2022-07-26 13:39:20 -0400
commitc3c07ed09eb9e5998f2c67f1054850a5b8266aae (patch)
tree8eb27fc68de4f474d4c37e8e13b0c7e893a3f4cc /pkg
parent6057db75d81101fcfe2e63debedd8d0029461de4 (diff)
downloadpodman-c3c07ed09eb9e5998f2c67f1054850a5b8266aae.tar.gz
podman-c3c07ed09eb9e5998f2c67f1054850a5b8266aae.tar.bz2
podman-c3c07ed09eb9e5998f2c67f1054850a5b8266aae.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,