diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-02-17 21:04:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-17 21:04:33 +0100 |
commit | 6aaf8d39a9a26510e40fd54399e97fe177afadde (patch) | |
tree | 3754ecbf29b1d8e63675894f25abde206b8308c3 /cmd/podman/run.go | |
parent | a99f4924d9d76f59e85bde09944d7c5e687ea8aa (diff) | |
parent | 81804fc4641d279fec8f9bf48b21b22fc90cb891 (diff) | |
download | podman-6aaf8d39a9a26510e40fd54399e97fe177afadde.tar.gz podman-6aaf8d39a9a26510e40fd54399e97fe177afadde.tar.bz2 podman-6aaf8d39a9a26510e40fd54399e97fe177afadde.zip |
Merge pull request #2295 from haircommander/recursive-start
Recursively start a pod if a container is run in it
Diffstat (limited to 'cmd/podman/run.go')
-rw-r--r-- | cmd/podman/run.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cmd/podman/run.go b/cmd/podman/run.go index 64f8b6856..45fc8df76 100644 --- a/cmd/podman/run.go +++ b/cmd/podman/run.go @@ -72,7 +72,8 @@ func runCmd(c *cliconfig.RunValues) error { ctx := getContext() // Handle detached start if createConfig.Detach { - if err := ctr.Start(ctx); err != nil { + // if the container was created as part of a pod, also start its dependencies, if any. + if err := ctr.Start(ctx, c.IsSet("pod")); err != nil { // This means the command did not exist exitCode = 127 if strings.Index(err.Error(), "permission denied") > -1 { @@ -117,7 +118,8 @@ func runCmd(c *cliconfig.RunValues) error { } } } - if err := startAttachCtr(ctr, outputStream, errorStream, inputStream, c.String("detach-keys"), c.Bool("sig-proxy"), true); err != nil { + // if the container was created as part of a pod, also start its dependencies, if any. + if err := startAttachCtr(ctr, outputStream, errorStream, inputStream, c.String("detach-keys"), c.Bool("sig-proxy"), true, c.IsSet("pod")); err != nil { // We've manually detached from the container // Do not perform cleanup, or wait for container exit code // Just exit immediately @@ -125,7 +127,6 @@ func runCmd(c *cliconfig.RunValues) error { exitCode = 0 return nil } - // This means the command did not exist exitCode = 127 if strings.Index(err.Error(), "permission denied") > -1 { |