diff options
author | Urvashi Mohnani <umohnani@redhat.com> | 2022-07-19 11:58:27 -0400 |
---|---|---|
committer | Urvashi Mohnani <umohnani@redhat.com> | 2022-07-20 10:02:32 -0400 |
commit | da33f100551ebd9b5e8790d677a1a8be2ea4fae4 (patch) | |
tree | daebdd87c3056614f7f74545db2fe392cf95371b /pkg/domain/infra | |
parent | 21cf30f2f895a3c453760f800077b8f7dbfce23c (diff) | |
download | podman-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/domain/infra')
-rw-r--r-- | pkg/domain/infra/abi/play.go | 6 |
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, |