summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/common/create.go8
-rw-r--r--cmd/podman/common/create_opts.go1
-rw-r--r--cmd/podman/common/specgen.go2
-rw-r--r--cmd/podman/machine/ssh.go2
-rw-r--r--cmd/podman/system/unshare.go6
5 files changed, 16 insertions, 3 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
diff --git a/cmd/podman/machine/ssh.go b/cmd/podman/machine/ssh.go
index 504fcbe46..ecc6d3b82 100644
--- a/cmd/podman/machine/ssh.go
+++ b/cmd/podman/machine/ssh.go
@@ -78,7 +78,7 @@ func ssh(cmd *cobra.Command, args []string) error {
vm, err = qemu.LoadVMByName(vmName)
}
if err != nil {
- return errors.Wrapf(err, "vm %s not found", args[0])
+ return errors.Wrapf(err, "vm %s not found", vmName)
}
return vm.SSH(vmName, sshOpts)
}
diff --git a/cmd/podman/system/unshare.go b/cmd/podman/system/unshare.go
index 5e6ff569b..c07751532 100644
--- a/cmd/podman/system/unshare.go
+++ b/cmd/podman/system/unshare.go
@@ -12,9 +12,10 @@ import (
)
var (
+ unshareOptions = entities.SystemUnshareOptions{}
unshareDescription = "Runs a command in a modified user namespace."
unshareCommand = &cobra.Command{
- Use: "unshare [COMMAND [ARG...]]",
+ Use: "unshare [options] [COMMAND [ARG...]]",
DisableFlagsInUseLine: true,
Short: "Run a command in a modified user namespace",
Long: unshareDescription,
@@ -33,6 +34,7 @@ func init() {
})
flags := unshareCommand.Flags()
flags.SetInterspersed(false)
+ flags.BoolVar(&unshareOptions.RootlessCNI, "rootless-cni", false, "Join the rootless network namespace used for CNI networking")
}
func unshare(cmd *cobra.Command, args []string) error {
@@ -49,5 +51,5 @@ func unshare(cmd *cobra.Command, args []string) error {
args = []string{shell}
}
- return registry.ContainerEngine().Unshare(registry.Context(), args)
+ return registry.ContainerEngine().Unshare(registry.Context(), args, unshareOptions)
}