summaryrefslogtreecommitdiff
path: root/pkg/specgen/generate/kube/kube.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-09-10 13:44:47 -0400
committerGitHub <noreply@github.com>2021-09-10 13:44:47 -0400
commit5e9758fd5f75d8e2be88c9a4b929cbbfd301fb70 (patch)
treed6d7eb5980534edf68c731731985684a90a5438e /pkg/specgen/generate/kube/kube.go
parente6046224ea88cad9286303456562b4a24ad9cf9b (diff)
parentf5e4ffb5e46be03a81b4425d3fe080543fca7035 (diff)
downloadpodman-5e9758fd5f75d8e2be88c9a4b929cbbfd301fb70.tar.gz
podman-5e9758fd5f75d8e2be88c9a4b929cbbfd301fb70.tar.bz2
podman-5e9758fd5f75d8e2be88c9a4b929cbbfd301fb70.zip
Merge pull request #11323 from umohnani8/init
Add init containers to generate and play kube
Diffstat (limited to 'pkg/specgen/generate/kube/kube.go')
-rw-r--r--pkg/specgen/generate/kube/kube.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/specgen/generate/kube/kube.go b/pkg/specgen/generate/kube/kube.go
index 5188abc3a..c01d7a1f0 100644
--- a/pkg/specgen/generate/kube/kube.go
+++ b/pkg/specgen/generate/kube/kube.go
@@ -114,6 +114,9 @@ type CtrSpecGenOptions struct {
Labels map[string]string
//
IsInfra bool
+ // InitContainerType sets what type the init container is
+ // Note: When playing a kube yaml, the inti container type will be set to "always" only
+ InitContainerType string
}
func ToSpecGen(ctx context.Context, opts *CtrSpecGenOptions) (*specgen.SpecGenerator, error) {
@@ -135,6 +138,8 @@ func ToSpecGen(ctx context.Context, opts *CtrSpecGenOptions) (*specgen.SpecGener
Driver: opts.LogDriver,
}
+ s.InitContainerType = opts.InitContainerType
+
setupSecurityContext(s, opts.Container)
err := setupLivenessProbe(s, opts.Container, opts.RestartPolicy)
if err != nil {