diff options
Diffstat (limited to 'cmd/podmanV2/main.go')
-rw-r--r-- | cmd/podmanV2/main.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/cmd/podmanV2/main.go b/cmd/podmanV2/main.go index dc96c26d0..fe3cd9f16 100644 --- a/cmd/podmanV2/main.go +++ b/cmd/podmanV2/main.go @@ -1,22 +1,23 @@ package main import ( - "fmt" "os" "reflect" "runtime" "strings" _ "github.com/containers/libpod/cmd/podmanV2/containers" + _ "github.com/containers/libpod/cmd/podmanV2/healthcheck" _ "github.com/containers/libpod/cmd/podmanV2/images" _ "github.com/containers/libpod/cmd/podmanV2/networks" _ "github.com/containers/libpod/cmd/podmanV2/pods" "github.com/containers/libpod/cmd/podmanV2/registry" + _ "github.com/containers/libpod/cmd/podmanV2/system" _ "github.com/containers/libpod/cmd/podmanV2/volumes" "github.com/containers/libpod/libpod" "github.com/containers/libpod/pkg/domain/entities" + "github.com/containers/storage/pkg/reexec" "github.com/sirupsen/logrus" - "github.com/spf13/cobra" ) func init() { @@ -24,10 +25,7 @@ func init() { logrus.Errorf(err.Error()) os.Exit(1) } - initCobra() -} -func initCobra() { switch runtime.GOOS { case "darwin": fallthrough @@ -46,12 +44,14 @@ func initCobra() { registry.EngineOptions.EngineMode = entities.TunnelMode } } - - cobra.OnInitialize(func() {}) } func main() { - fmt.Fprintf(os.Stderr, "Number of commands: %d\n", len(registry.Commands)) + if reexec.Init() { + // We were invoked with a different argv[0] indicating that we + // had a specific job to do as a subprocess, and it's done. + return + } for _, c := range registry.Commands { if Contains(registry.EngineOptions.EngineMode, c.Mode) { parent := rootCmd |