From 3c3fa6fac4d0f8e89181ea2d4e1fe0318d24b6f4 Mon Sep 17 00:00:00 2001 From: Brent Baude Date: Wed, 14 Jul 2021 16:03:55 -0500 Subject: 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 --- cmd/podman/common/create_opts.go | 1 + cmd/podman/common/specgen.go | 2 ++ 2 files changed, 3 insertions(+) (limited to 'cmd/podman/common') diff --git a/cmd/podman/common/create_opts.go b/cmd/podman/common/create_opts.go index 42e0efe5d..61f08b73b 100644 --- a/cmd/podman/common/create_opts.go +++ b/cmd/podman/common/create_opts.go @@ -61,6 +61,7 @@ type ContainerCLIOpts struct { HTTPProxy bool ImageVolume string Init bool + InitContainerType string InitPath string Interactive bool IPC string diff --git a/cmd/podman/common/specgen.go b/cmd/podman/common/specgen.go index 42f515ace..118091855 100644 --- a/cmd/podman/common/specgen.go +++ b/cmd/podman/common/specgen.go @@ -659,6 +659,8 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string s.PidFile = c.PidFile s.Volatile = c.Rm + // Initcontainers + s.InitContainerType = c.InitContainerType return nil } -- cgit v1.2.3-54-g00ecf