summaryrefslogtreecommitdiff
path: root/cmd/podman/system
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-09-12 08:51:53 -0400
committerMatthew Heon <mheon@redhat.com>2021-09-16 09:42:14 -0400
commitc6e4453f6223bbb2b6cfd5242c0d9af55cd8b121 (patch)
treeb3d6f7afeaf21f5a88216a96d572f4de8cdebf79 /cmd/podman/system
parent5829d62ea0c08e358eb287636673316080d51001 (diff)
downloadpodman-c6e4453f6223bbb2b6cfd5242c0d9af55cd8b121.tar.gz
podman-c6e4453f6223bbb2b6cfd5242c0d9af55cd8b121.tar.bz2
podman-c6e4453f6223bbb2b6cfd5242c0d9af55cd8b121.zip
If container exits with 125 podman should exit with 125
fixes: https://github.com/containers/podman/issues/11540 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/system')
-rw-r--r--cmd/podman/system/migrate.go5
-rw-r--r--cmd/podman/system/renumber.go5
-rw-r--r--cmd/podman/system/reset.go5
3 files changed, 9 insertions, 6 deletions
diff --git a/cmd/podman/system/migrate.go b/cmd/podman/system/migrate.go
index b9dc272d7..d78ac7286 100644
--- a/cmd/podman/system/migrate.go
+++ b/cmd/podman/system/migrate.go
@@ -9,6 +9,7 @@ import (
"github.com/containers/common/pkg/completion"
"github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/cmd/podman/validate"
+ "github.com/containers/podman/v3/libpod/define"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/containers/podman/v3/pkg/domain/infra"
"github.com/spf13/cobra"
@@ -60,14 +61,14 @@ func migrate(cmd *cobra.Command, args []string) {
engine, err := infra.NewSystemEngine(entities.MigrateMode, registry.PodmanConfig())
if err != nil {
fmt.Println(err)
- os.Exit(125)
+ os.Exit(define.ExecErrorCodeGeneric)
}
defer engine.Shutdown(registry.Context())
err = engine.Migrate(registry.Context(), cmd.Flags(), registry.PodmanConfig(), migrateOptions)
if err != nil {
fmt.Println(err)
- os.Exit(125)
+ os.Exit(define.ExecErrorCodeGeneric)
}
os.Exit(0)
}
diff --git a/cmd/podman/system/renumber.go b/cmd/podman/system/renumber.go
index 83a873c2a..f27abf570 100644
--- a/cmd/podman/system/renumber.go
+++ b/cmd/podman/system/renumber.go
@@ -9,6 +9,7 @@ import (
"github.com/containers/common/pkg/completion"
"github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/cmd/podman/validate"
+ "github.com/containers/podman/v3/libpod/define"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/containers/podman/v3/pkg/domain/infra"
"github.com/spf13/cobra"
@@ -47,14 +48,14 @@ func renumber(cmd *cobra.Command, args []string) {
engine, err := infra.NewSystemEngine(entities.RenumberMode, registry.PodmanConfig())
if err != nil {
fmt.Println(err)
- os.Exit(125)
+ os.Exit(define.ExecErrorCodeGeneric)
}
defer engine.Shutdown(registry.Context())
err = engine.Renumber(registry.Context(), cmd.Flags(), registry.PodmanConfig())
if err != nil {
fmt.Println(err)
- os.Exit(125)
+ os.Exit(define.ExecErrorCodeGeneric)
}
os.Exit(0)
}
diff --git a/cmd/podman/system/reset.go b/cmd/podman/system/reset.go
index c64d09ed2..8a05bb09f 100644
--- a/cmd/podman/system/reset.go
+++ b/cmd/podman/system/reset.go
@@ -11,6 +11,7 @@ import (
"github.com/containers/common/pkg/completion"
"github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/cmd/podman/validate"
+ "github.com/containers/podman/v3/libpod/define"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/containers/podman/v3/pkg/domain/infra"
"github.com/sirupsen/logrus"
@@ -87,13 +88,13 @@ WARNING! This will remove:
engine, err := infra.NewSystemEngine(entities.ResetMode, registry.PodmanConfig())
if err != nil {
logrus.Error(err)
- os.Exit(125)
+ os.Exit(define.ExecErrorCodeGeneric)
}
defer engine.Shutdown(registry.Context())
if err := engine.Reset(registry.Context()); err != nil {
logrus.Error(err)
- os.Exit(125)
+ os.Exit(define.ExecErrorCodeGeneric)
}
os.Exit(0)
}