diff options
author | Jhon Honce <jhonce@redhat.com> | 2021-05-18 11:23:25 -0700 |
---|---|---|
committer | Jhon Honce <jhonce@redhat.com> | 2021-05-27 11:40:43 -0700 |
commit | 33944cefe7c1f3e11c8389bedb3e4c80af8541bd (patch) | |
tree | 594d3da7b2cb2a8620be0afbca2cd27087192326 /cmd/podman/pods | |
parent | 4f4a440afd521913745c314f2bebd0da45d9668e (diff) | |
download | podman-33944cefe7c1f3e11c8389bedb3e4c80af8541bd.tar.gz podman-33944cefe7c1f3e11c8389bedb3e4c80af8541bd.tar.bz2 podman-33944cefe7c1f3e11c8389bedb3e4c80af8541bd.zip |
[Techinal Debt] Cleanup ABI vs. Tunnel CLI commands
[NO TESTS NEEDED]
This commit cleans up two issues:
* Most commands support all EngineModes so default to that. Let
outlayers declare their intent.
* Use cobra.Annotations to set supported EngineMode. This simplies
instantiating commands as there is now one method to communicate a
commands requirements rather than two.
* Combined aliased commands into one file
* Fixed aliased commands where Args field did not match
* Updated examples in README.md for writing commands
* Remove redundant flag DisableFlagsInUseLine in cobra.Command
initialization.
Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'cmd/podman/pods')
-rw-r--r-- | cmd/podman/pods/create.go | 1 | ||||
-rw-r--r-- | cmd/podman/pods/exists.go | 3 | ||||
-rw-r--r-- | cmd/podman/pods/inspect.go | 1 | ||||
-rw-r--r-- | cmd/podman/pods/kill.go | 1 | ||||
-rw-r--r-- | cmd/podman/pods/pause.go | 1 | ||||
-rw-r--r-- | cmd/podman/pods/pod.go | 2 | ||||
-rw-r--r-- | cmd/podman/pods/prune.go | 1 | ||||
-rw-r--r-- | cmd/podman/pods/ps.go | 1 | ||||
-rw-r--r-- | cmd/podman/pods/restart.go | 1 | ||||
-rw-r--r-- | cmd/podman/pods/rm.go | 1 | ||||
-rw-r--r-- | cmd/podman/pods/start.go | 1 | ||||
-rw-r--r-- | cmd/podman/pods/stats.go | 1 | ||||
-rw-r--r-- | cmd/podman/pods/stop.go | 1 | ||||
-rw-r--r-- | cmd/podman/pods/top.go | 1 | ||||
-rw-r--r-- | cmd/podman/pods/unpause.go | 1 |
15 files changed, 0 insertions, 18 deletions
diff --git a/cmd/podman/pods/create.go b/cmd/podman/pods/create.go index 5600d8794..3c2c8a3bc 100644 --- a/cmd/podman/pods/create.go +++ b/cmd/podman/pods/create.go @@ -47,7 +47,6 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: createCommand, Parent: podCmd, }) diff --git a/cmd/podman/pods/exists.go b/cmd/podman/pods/exists.go index a9ef0370b..c4e64f88e 100644 --- a/cmd/podman/pods/exists.go +++ b/cmd/podman/pods/exists.go @@ -5,7 +5,6 @@ import ( "github.com/containers/podman/v3/cmd/podman/common" "github.com/containers/podman/v3/cmd/podman/registry" - "github.com/containers/podman/v3/pkg/domain/entities" "github.com/spf13/cobra" ) @@ -21,13 +20,11 @@ var ( ValidArgsFunction: common.AutocompletePods, Example: `podman pod exists podID podman pod exists mypod || podman pod create --name mypod`, - DisableFlagsInUseLine: true, } ) func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: existsCommand, Parent: podCmd, }) diff --git a/cmd/podman/pods/inspect.go b/cmd/podman/pods/inspect.go index c66b81adb..d38f0062c 100644 --- a/cmd/podman/pods/inspect.go +++ b/cmd/podman/pods/inspect.go @@ -37,7 +37,6 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: inspectCmd, Parent: podCmd, }) diff --git a/cmd/podman/pods/kill.go b/cmd/podman/pods/kill.go index 17d5499c8..66693b419 100644 --- a/cmd/podman/pods/kill.go +++ b/cmd/podman/pods/kill.go @@ -37,7 +37,6 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: killCommand, Parent: podCmd, }) diff --git a/cmd/podman/pods/pause.go b/cmd/podman/pods/pause.go index 6624ccbd7..c1cc151e0 100644 --- a/cmd/podman/pods/pause.go +++ b/cmd/podman/pods/pause.go @@ -37,7 +37,6 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: pauseCommand, Parent: podCmd, }) diff --git a/cmd/podman/pods/pod.go b/cmd/podman/pods/pod.go index 00fb02936..e6e23fd1f 100644 --- a/cmd/podman/pods/pod.go +++ b/cmd/podman/pods/pod.go @@ -3,7 +3,6 @@ package pods import ( "github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/validate" - "github.com/containers/podman/v3/pkg/domain/entities" "github.com/containers/podman/v3/pkg/util" "github.com/spf13/cobra" ) @@ -24,7 +23,6 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: podCmd, }) } diff --git a/cmd/podman/pods/prune.go b/cmd/podman/pods/prune.go index 51b6bb4a9..8032c9f12 100644 --- a/cmd/podman/pods/prune.go +++ b/cmd/podman/pods/prune.go @@ -35,7 +35,6 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: pruneCommand, Parent: podCmd, }) diff --git a/cmd/podman/pods/ps.go b/cmd/podman/pods/ps.go index beaeda871..0271930e8 100644 --- a/cmd/podman/pods/ps.go +++ b/cmd/podman/pods/ps.go @@ -45,7 +45,6 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: psCmd, Parent: podCmd, }) diff --git a/cmd/podman/pods/restart.go b/cmd/podman/pods/restart.go index 5b9f47a5b..5b7ea121d 100644 --- a/cmd/podman/pods/restart.go +++ b/cmd/podman/pods/restart.go @@ -37,7 +37,6 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: restartCommand, Parent: podCmd, }) diff --git a/cmd/podman/pods/rm.go b/cmd/podman/pods/rm.go index 333e4eb9f..fbaf64c1f 100644 --- a/cmd/podman/pods/rm.go +++ b/cmd/podman/pods/rm.go @@ -45,7 +45,6 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: rmCommand, Parent: podCmd, }) diff --git a/cmd/podman/pods/start.go b/cmd/podman/pods/start.go index f6dca854e..e39891a9b 100644 --- a/cmd/podman/pods/start.go +++ b/cmd/podman/pods/start.go @@ -45,7 +45,6 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: startCommand, Parent: podCmd, }) diff --git a/cmd/podman/pods/stats.go b/cmd/podman/pods/stats.go index 97147275e..057b3dead 100644 --- a/cmd/podman/pods/stats.go +++ b/cmd/podman/pods/stats.go @@ -48,7 +48,6 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: statsCmd, Parent: podCmd, }) diff --git a/cmd/podman/pods/stop.go b/cmd/podman/pods/stop.go index a9a16b39c..bcc054b8e 100644 --- a/cmd/podman/pods/stop.go +++ b/cmd/podman/pods/stop.go @@ -46,7 +46,6 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: stopCommand, Parent: podCmd, }) diff --git a/cmd/podman/pods/top.go b/cmd/podman/pods/top.go index be8aab761..e26e281c8 100644 --- a/cmd/podman/pods/top.go +++ b/cmd/podman/pods/top.go @@ -39,7 +39,6 @@ podman pod top podID -eo user,pid,comm`, func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: topCommand, Parent: podCmd, }) diff --git a/cmd/podman/pods/unpause.go b/cmd/podman/pods/unpause.go index 859ac8ac2..ef1aea7c8 100644 --- a/cmd/podman/pods/unpause.go +++ b/cmd/podman/pods/unpause.go @@ -39,7 +39,6 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: unpauseCommand, Parent: podCmd, }) |