summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-04-09 03:02:55 +0200
committerGitHub <noreply@github.com>2020-04-09 03:02:55 +0200
commit3c94fa9cc77b6f15734f4be7e3794db603667fef (patch)
tree3cc5885813979f5691e21cd003c22f9a76c724f9 /cmd
parent12293503775a0239094fb19dee140d879cf2d8d3 (diff)
parent82bd7589e7a6c930c6ddfce43d956304cb3e3f8b (diff)
downloadpodman-3c94fa9cc77b6f15734f4be7e3794db603667fef.tar.gz
podman-3c94fa9cc77b6f15734f4be7e3794db603667fef.tar.bz2
podman-3c94fa9cc77b6f15734f4be7e3794db603667fef.zip
Merge pull request #5758 from rhatdan/exitcode
Set exit codes on errors.
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podmanV2/containers/run.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd/podmanV2/containers/run.go b/cmd/podmanV2/containers/run.go
index 5c0069afc..f839c358d 100644
--- a/cmd/podmanV2/containers/run.go
+++ b/cmd/podmanV2/containers/run.go
@@ -109,13 +109,14 @@ func run(cmd *cobra.Command, args []string) error {
}
runOpts.Spec = s
report, err := registry.ContainerEngine().ContainerRun(registry.GetContext(), runOpts)
+ // report.ExitCode is set by ContainerRun even it it returns an error
+ registry.SetExitCode(report.ExitCode)
if err != nil {
return err
}
if cliVals.Detach {
fmt.Println(report.Id)
}
- registry.SetExitCode(report.ExitCode)
if runRmi {
_, err := registry.ImageEngine().Delete(registry.GetContext(), []string{report.Id}, entities.ImageDeleteOptions{})
if err != nil {