summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-09-08 17:21:55 -0400
committerGitHub <noreply@github.com>2020-09-08 17:21:55 -0400
commit814784c5e6b9795d62a2c7624bc8884bd1011287 (patch)
tree37600307c94d3902c02c4c24a73231c31f1c6bf2 /cmd
parente180de8b3c64809e5312867c6e70dfcca704539b (diff)
parentea71f613e6cf0a346535372e6e68fbcc9a364b66 (diff)
downloadpodman-814784c5e6b9795d62a2c7624bc8884bd1011287.tar.gz
podman-814784c5e6b9795d62a2c7624bc8884bd1011287.tar.bz2
podman-814784c5e6b9795d62a2c7624bc8884bd1011287.zip
Merge pull request #7564 from Luap99/remote-subcmds-usage
Don't setup the Image/ContainerEngine when calling a cmd with subcmds
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/root.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/podman/root.go b/cmd/podman/root.go
index 749a5fbe7..6cf369f0a 100644
--- a/cmd/podman/root.go
+++ b/cmd/podman/root.go
@@ -104,8 +104,8 @@ func persistentPreRunE(cmd *cobra.Command, args []string) error {
// TODO: Remove trace statement in podman V2.1
logrus.Debugf("Called %s.PersistentPreRunE(%s)", cmd.Name(), strings.Join(os.Args, " "))
- // Help is a special case, no need for more setup
- if cmd.Name() == "help" {
+ // Help and commands with subcommands are special cases, no need for more setup
+ if cmd.Name() == "help" || cmd.HasSubCommands() {
return nil
}
@@ -204,8 +204,8 @@ func persistentPostRunE(cmd *cobra.Command, args []string) error {
// TODO: Remove trace statement in podman V2.1
logrus.Debugf("Called %s.PersistentPostRunE(%s)", cmd.Name(), strings.Join(os.Args, " "))
- // Help is a special case, no need for more cleanup
- if cmd.Name() == "help" {
+ // Help and commands with subcommands are special cases, no need for more cleanup
+ if cmd.Name() == "help" || cmd.HasSubCommands() {
return nil
}