diff options
Diffstat (limited to 'cmd/podman/common')
-rw-r--r-- | cmd/podman/common/create.go | 8 | ||||
-rw-r--r-- | cmd/podman/common/create_opts.go | 1 | ||||
-rw-r--r-- | cmd/podman/common/specgen.go | 2 |
3 files changed, 11 insertions, 0 deletions
diff --git a/cmd/podman/common/create.go b/cmd/podman/common/create.go index dda709ecd..220a30a10 100644 --- a/cmd/podman/common/create.go +++ b/cmd/podman/common/create.go @@ -576,6 +576,14 @@ func DefineCreateFlags(cmd *cobra.Command, cf *ContainerCLIOpts) { `If a container with the same name exists, replace it`, ) + requiresFlagName := "requires" + createFlags.StringSliceVar( + &cf.Requires, + requiresFlagName, []string{}, + "Add one or more requirement containers that must be started before this container will start", + ) + _ = cmd.RegisterFlagCompletionFunc(requiresFlagName, AutocompleteContainers) + restartFlagName := "restart" createFlags.StringVar( &cf.Restart, diff --git a/cmd/podman/common/create_opts.go b/cmd/podman/common/create_opts.go index a296ef4f1..e14918fe1 100644 --- a/cmd/podman/common/create_opts.go +++ b/cmd/podman/common/create_opts.go @@ -93,6 +93,7 @@ type ContainerCLIOpts struct { ReadOnlyTmpFS bool Restart string Replace bool + Requires []string Rm bool RootFS bool Secrets []string diff --git a/cmd/podman/common/specgen.go b/cmd/podman/common/specgen.go index d1b67d963..363a8f5f9 100644 --- a/cmd/podman/common/specgen.go +++ b/cmd/podman/common/specgen.go @@ -486,6 +486,8 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string s.ReadOnlyFilesystem = c.ReadOnly s.ConmonPidFile = c.ConmonPIDFile + s.DependencyContainers = c.Requires + // TODO // outside of specgen and oci though // defaults to true, check spec/storage |