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/images | |
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/images')
-rw-r--r-- | cmd/podman/images/build.go | 3 | ||||
-rw-r--r-- | cmd/podman/images/diff.go | 1 | ||||
-rw-r--r-- | cmd/podman/images/exists.go | 3 | ||||
-rw-r--r-- | cmd/podman/images/history.go | 2 | ||||
-rw-r--r-- | cmd/podman/images/image.go | 2 | ||||
-rw-r--r-- | cmd/podman/images/images.go | 32 | ||||
-rw-r--r-- | cmd/podman/images/import.go | 2 | ||||
-rw-r--r-- | cmd/podman/images/inspect.go | 1 | ||||
-rw-r--r-- | cmd/podman/images/list.go | 26 | ||||
-rw-r--r-- | cmd/podman/images/load.go | 2 | ||||
-rw-r--r-- | cmd/podman/images/mount.go | 10 | ||||
-rw-r--r-- | cmd/podman/images/prune.go | 1 | ||||
-rw-r--r-- | cmd/podman/images/pull.go | 2 | ||||
-rw-r--r-- | cmd/podman/images/push.go | 2 | ||||
-rw-r--r-- | cmd/podman/images/rm.go | 18 | ||||
-rw-r--r-- | cmd/podman/images/rmi.go | 29 | ||||
-rw-r--r-- | cmd/podman/images/save.go | 3 | ||||
-rw-r--r-- | cmd/podman/images/search.go | 7 | ||||
-rw-r--r-- | cmd/podman/images/sign.go | 2 | ||||
-rw-r--r-- | cmd/podman/images/tag.go | 28 | ||||
-rw-r--r-- | cmd/podman/images/tree.go | 1 | ||||
-rw-r--r-- | cmd/podman/images/trust.go | 11 | ||||
-rw-r--r-- | cmd/podman/images/trust_set.go | 2 | ||||
-rw-r--r-- | cmd/podman/images/trust_show.go | 2 | ||||
-rw-r--r-- | cmd/podman/images/unmount.go | 2 | ||||
-rw-r--r-- | cmd/podman/images/untag.go | 36 |
26 files changed, 80 insertions, 150 deletions
diff --git a/cmd/podman/images/build.go b/cmd/podman/images/build.go index 04fdeab0a..dfb7415a9 100644 --- a/cmd/podman/images/build.go +++ b/cmd/podman/images/build.go @@ -82,14 +82,11 @@ func useLayers() string { func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, - Command: buildCmd, }) buildFlags(buildCmd) registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: imageBuildCmd, Parent: imageCmd, }) diff --git a/cmd/podman/images/diff.go b/cmd/podman/images/diff.go index 7f4c3e83d..2e883d7ae 100644 --- a/cmd/podman/images/diff.go +++ b/cmd/podman/images/diff.go @@ -27,7 +27,6 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: diffCmd, Parent: imageCmd, }) diff --git a/cmd/podman/images/exists.go b/cmd/podman/images/exists.go index 332510b3d..d278eafda 100644 --- a/cmd/podman/images/exists.go +++ b/cmd/podman/images/exists.go @@ -3,7 +3,6 @@ package images 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" ) @@ -17,13 +16,11 @@ var ( ValidArgsFunction: common.AutocompleteImages, Example: `podman image exists ID podman image exists IMAGE && podman pull IMAGE`, - DisableFlagsInUseLine: true, } ) func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: existsCmd, Parent: imageCmd, }) diff --git a/cmd/podman/images/history.go b/cmd/podman/images/history.go index 16be0bb19..69268c261 100644 --- a/cmd/podman/images/history.go +++ b/cmd/podman/images/history.go @@ -56,13 +56,11 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: historyCmd, }) historyFlags(historyCmd) registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: imageHistoryCmd, Parent: imageCmd, }) diff --git a/cmd/podman/images/image.go b/cmd/podman/images/image.go index 69563959d..92d1348bf 100644 --- a/cmd/podman/images/image.go +++ b/cmd/podman/images/image.go @@ -3,7 +3,6 @@ package images 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/spf13/cobra" ) @@ -22,7 +21,6 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: imageCmd, }) } diff --git a/cmd/podman/images/images.go b/cmd/podman/images/images.go deleted file mode 100644 index 17fe21911..000000000 --- a/cmd/podman/images/images.go +++ /dev/null @@ -1,32 +0,0 @@ -package images - -import ( - "strings" - - "github.com/containers/podman/v3/cmd/podman/registry" - "github.com/containers/podman/v3/pkg/domain/entities" - "github.com/spf13/cobra" -) - -var ( - // podman _images_ Alias for podman image _list_ - imagesCmd = &cobra.Command{ - Use: strings.Replace(listCmd.Use, "list", "images", 1), - Args: listCmd.Args, - Short: listCmd.Short, - Long: listCmd.Long, - RunE: listCmd.RunE, - ValidArgsFunction: listCmd.ValidArgsFunction, - Example: strings.Replace(listCmd.Example, "podman image list", "podman images", -1), - DisableFlagsInUseLine: true, - } -) - -func init() { - registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, - Command: imagesCmd, - }) - - imageListFlagSet(imagesCmd) -} diff --git a/cmd/podman/images/import.go b/cmd/podman/images/import.go index 72e0b63ba..bed2d4105 100644 --- a/cmd/podman/images/import.go +++ b/cmd/podman/images/import.go @@ -51,13 +51,11 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: importCommand, }) importFlags(importCommand) registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: imageImportCommand, Parent: imageCmd, }) diff --git a/cmd/podman/images/inspect.go b/cmd/podman/images/inspect.go index ac3becaa6..35c173a60 100644 --- a/cmd/podman/images/inspect.go +++ b/cmd/podman/images/inspect.go @@ -26,7 +26,6 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: inspectCmd, Parent: imageCmd, }) diff --git a/cmd/podman/images/list.go b/cmd/podman/images/list.go index 132af858b..cc38a45c7 100644 --- a/cmd/podman/images/list.go +++ b/cmd/podman/images/list.go @@ -34,8 +34,7 @@ type listFlagType struct { } var ( - // Command: podman image _list_ - listCmd = &cobra.Command{ + imageListCmd = &cobra.Command{ Use: "list [options] [IMAGE]", Aliases: []string{"ls"}, Args: cobra.MaximumNArgs(1), @@ -46,7 +45,18 @@ var ( Example: `podman image list --format json podman image list --sort repository --format "table {{.ID}} {{.Repository}} {{.Tag}}" podman image list --filter dangling=true`, - DisableFlagsInUseLine: true, + } + + imagesCmd = &cobra.Command{ + Use: "images [options] [IMAGE]", + Args: imageListCmd.Args, + Short: imageListCmd.Short, + Long: imageListCmd.Long, + RunE: imageListCmd.RunE, + ValidArgsFunction: imageListCmd.ValidArgsFunction, + Example: `podman images --format json + podman images --sort repository --format "table {{.ID}} {{.Repository}} {{.Tag}}" + podman images --filter dangling=true`, } // Options to pull data @@ -65,11 +75,15 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, - Command: listCmd, + Command: imageListCmd, Parent: imageCmd, }) - imageListFlagSet(listCmd) + imageListFlagSet(imageListCmd) + + registry.Commands = append(registry.Commands, registry.CliCommand{ + Command: imagesCmd, + }) + imageListFlagSet(imagesCmd) } func imageListFlagSet(cmd *cobra.Command) { diff --git a/cmd/podman/images/load.go b/cmd/podman/images/load.go index aac95dae8..c7b7d6b3f 100644 --- a/cmd/podman/images/load.go +++ b/cmd/podman/images/load.go @@ -45,12 +45,10 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: loadCommand, }) loadFlags(loadCommand) registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: imageLoadCommand, Parent: imageCmd, }) diff --git a/cmd/podman/images/mount.go b/cmd/podman/images/mount.go index a098aac63..efcff8264 100644 --- a/cmd/podman/images/mount.go +++ b/cmd/podman/images/mount.go @@ -24,6 +24,11 @@ var ( ` mountCommand = &cobra.Command{ + Annotations: map[string]string{ + registry.UnshareNSRequired: "", + registry.ParentNSRequired: "", + registry.EngineMode: registry.ABIMode, + }, Use: "mount [options] [IMAGE...]", Short: "Mount an image's root filesystem", Long: mountDescription, @@ -33,10 +38,6 @@ var ( podman image mount imgID1 imgID2 imgID3 podman image mount podman image mount --all`, - Annotations: map[string]string{ - registry.UnshareNSRequired: "", - registry.ParentNSRequired: "", - }, } ) @@ -56,7 +57,6 @@ func mountFlags(cmd *cobra.Command) { func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode}, Command: mountCommand, Parent: imageCmd, }) diff --git a/cmd/podman/images/prune.go b/cmd/podman/images/prune.go index db645cc2e..a082255f6 100644 --- a/cmd/podman/images/prune.go +++ b/cmd/podman/images/prune.go @@ -34,7 +34,6 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: pruneCmd, Parent: imageCmd, }) diff --git a/cmd/podman/images/pull.go b/cmd/podman/images/pull.go index bf0eec759..a831ea848 100644 --- a/cmd/podman/images/pull.go +++ b/cmd/podman/images/pull.go @@ -60,14 +60,12 @@ var ( func init() { // pull registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: pullCmd, }) pullFlags(pullCmd) // images pull registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: imagesPullCmd, Parent: imageCmd, }) diff --git a/cmd/podman/images/push.go b/cmd/podman/images/push.go index 9e7b447a4..edf8e9203 100644 --- a/cmd/podman/images/push.go +++ b/cmd/podman/images/push.go @@ -57,14 +57,12 @@ var ( func init() { // push registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: pushCmd, }) pushFlags(pushCmd) // images push registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: imagePushCmd, Parent: imageCmd, }) diff --git a/cmd/podman/images/rm.go b/cmd/podman/images/rm.go index 2daa4743f..be4c0b883 100644 --- a/cmd/podman/images/rm.go +++ b/cmd/podman/images/rm.go @@ -25,17 +25,33 @@ var ( podman image rm c4dfb1609ee2 93fd78260bd1 c0ed59d05ff7`, } + rmiCmd = &cobra.Command{ + Use: "rmi [options] IMAGE [IMAGE...]", + Args: rmCmd.Args, + Short: rmCmd.Short, + Long: rmCmd.Long, + RunE: rmCmd.RunE, + ValidArgsFunction: rmCmd.ValidArgsFunction, + Example: `podman rmi imageID + podman rmi --force alpine + podman rmi c4dfb1609ee2 93fd78260bd1 c0ed59d05ff7`, + } + imageOpts = entities.ImageRemoveOptions{} ) func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: rmCmd, Parent: imageCmd, }) imageRemoveFlagSet(rmCmd.Flags()) + + registry.Commands = append(registry.Commands, registry.CliCommand{ + Command: rmiCmd, + }) + imageRemoveFlagSet(rmiCmd.Flags()) } func imageRemoveFlagSet(flags *pflag.FlagSet) { diff --git a/cmd/podman/images/rmi.go b/cmd/podman/images/rmi.go deleted file mode 100644 index edd6ae96f..000000000 --- a/cmd/podman/images/rmi.go +++ /dev/null @@ -1,29 +0,0 @@ -package images - -import ( - "strings" - - "github.com/containers/podman/v3/cmd/podman/registry" - "github.com/containers/podman/v3/pkg/domain/entities" - "github.com/spf13/cobra" -) - -var ( - rmiCmd = &cobra.Command{ - Use: strings.Replace(rmCmd.Use, "rm ", "rmi ", 1), - Args: rmCmd.Args, - Short: rmCmd.Short, - Long: rmCmd.Long, - RunE: rmCmd.RunE, - ValidArgsFunction: rmCmd.ValidArgsFunction, - Example: strings.Replace(rmCmd.Example, "podman image rm", "podman rmi", -1), - } -) - -func init() { - registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, - Command: rmiCmd, - }) - imageRemoveFlagSet(rmiCmd.Flags()) -} diff --git a/cmd/podman/images/save.go b/cmd/podman/images/save.go index f1f7e8b2e..19dadb2ad 100644 --- a/cmd/podman/images/save.go +++ b/cmd/podman/images/save.go @@ -48,6 +48,7 @@ var ( podman save --format docker-dir -o ubuntu-dir ubuntu podman save > alpine-all.tar alpine:latest`, } + imageSaveCommand = &cobra.Command{ Args: saveCommand.Args, Use: saveCommand.Use, @@ -67,13 +68,11 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: saveCommand, }) saveFlags(saveCommand) registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: imageSaveCommand, Parent: imageCmd, }) diff --git a/cmd/podman/images/search.go b/cmd/podman/images/search.go index a3cfa983f..08bf3cf6b 100644 --- a/cmd/podman/images/search.go +++ b/cmd/podman/images/search.go @@ -38,7 +38,6 @@ var ( Users can limit the number of results, and filter the output based on certain conditions.` - // Command: podman search searchCmd = &cobra.Command{ Use: "search [options] TERM", Short: "Search registry for image", @@ -51,14 +50,12 @@ var ( podman search --format "table {{.Index}} {{.Name}}" registry.fedoraproject.org/fedora`, } - // Command: podman image search imageSearchCmd = &cobra.Command{ Use: searchCmd.Use, Short: searchCmd.Short, Long: searchCmd.Long, RunE: searchCmd.RunE, Args: searchCmd.Args, - Annotations: searchCmd.Annotations, ValidArgsFunction: searchCmd.ValidArgsFunction, Example: `podman image search --filter=is-official --limit 3 alpine podman image search registry.fedoraproject.org/ # only works with v2 registries @@ -67,16 +64,12 @@ var ( ) func init() { - // search registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: searchCmd, }) searchFlags(searchCmd) - // images search registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: imageSearchCmd, Parent: imageCmd, }) diff --git a/cmd/podman/images/sign.go b/cmd/podman/images/sign.go index fcd904bb7..96f214d0b 100644 --- a/cmd/podman/images/sign.go +++ b/cmd/podman/images/sign.go @@ -14,6 +14,7 @@ import ( var ( signDescription = "Create a signature file that can be used later to verify the image." signCommand = &cobra.Command{ + Annotations: map[string]string{registry.EngineMode: registry.ABIMode}, Use: "sign [options] IMAGE [IMAGE...]", Short: "Sign an image", Long: signDescription, @@ -31,7 +32,6 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode}, Command: signCommand, Parent: imageCmd, }) diff --git a/cmd/podman/images/tag.go b/cmd/podman/images/tag.go index 695ca30ed..633368f50 100644 --- a/cmd/podman/images/tag.go +++ b/cmd/podman/images/tag.go @@ -10,26 +10,24 @@ import ( var ( tagDescription = "Adds one or more additional names to locally-stored image." tagCommand = &cobra.Command{ - Use: "tag IMAGE TARGET_NAME [TARGET_NAME...]", - Short: "Add an additional name to a local image", - Long: tagDescription, - RunE: tag, - Args: cobra.MinimumNArgs(2), - DisableFlagsInUseLine: true, - ValidArgsFunction: common.AutocompleteImages, + Use: "tag IMAGE TARGET_NAME [TARGET_NAME...]", + Short: "Add an additional name to a local image", + Long: tagDescription, + RunE: tag, + Args: cobra.MinimumNArgs(2), + ValidArgsFunction: common.AutocompleteImages, Example: `podman tag 0e3bbc2 fedora:latest podman tag imageID:latest myNewImage:newTag podman tag httpd myregistryhost:5000/fedora/httpd:v2`, } imageTagCommand = &cobra.Command{ - Args: tagCommand.Args, - DisableFlagsInUseLine: true, - Use: tagCommand.Use, - Short: tagCommand.Short, - Long: tagCommand.Long, - RunE: tagCommand.RunE, - ValidArgsFunction: tagCommand.ValidArgsFunction, + Args: tagCommand.Args, + Use: tagCommand.Use, + Short: tagCommand.Short, + Long: tagCommand.Long, + RunE: tagCommand.RunE, + ValidArgsFunction: tagCommand.ValidArgsFunction, Example: `podman image tag 0e3bbc2 fedora:latest podman image tag imageID:latest myNewImage:newTag podman image tag httpd myregistryhost:5000/fedora/httpd:v2`, @@ -38,11 +36,9 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: tagCommand, }) registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: imageTagCommand, Parent: imageCmd, }) diff --git a/cmd/podman/images/tree.go b/cmd/podman/images/tree.go index 0a659c914..8ace9d63c 100644 --- a/cmd/podman/images/tree.go +++ b/cmd/podman/images/tree.go @@ -25,7 +25,6 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: treeCmd, Parent: imageCmd, }) diff --git a/cmd/podman/images/trust.go b/cmd/podman/images/trust.go index 2c51bb5f8..28eb53193 100644 --- a/cmd/podman/images/trust.go +++ b/cmd/podman/images/trust.go @@ -3,7 +3,6 @@ package images 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/spf13/cobra" ) @@ -11,16 +10,16 @@ var ( trustDescription = `Manages which registries you trust as a source of container images based on their location. The location is determined by the transport and the registry host of the image. Using this container image docker://quay.io/podman/stable as an example, docker is the transport and quay.io is the registry host.` trustCmd = &cobra.Command{ - Use: "trust", - Short: "Manage container image trust policy", - Long: trustDescription, - RunE: validate.SubCommandExists, + Annotations: map[string]string{registry.EngineMode: registry.ABIMode}, + Use: "trust", + Short: "Manage container image trust policy", + Long: trustDescription, + RunE: validate.SubCommandExists, } ) func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode}, Command: trustCmd, Parent: imageCmd, }) diff --git a/cmd/podman/images/trust_set.go b/cmd/podman/images/trust_set.go index c192669a9..e01a04146 100644 --- a/cmd/podman/images/trust_set.go +++ b/cmd/podman/images/trust_set.go @@ -16,6 +16,7 @@ import ( var ( setTrustDescription = "Set default trust policy or add a new trust policy for a registry" setTrustCommand = &cobra.Command{ + Annotations: map[string]string{registry.EngineMode: registry.ABIMode}, Use: "set [options] REGISTRY", Short: "Set default trust policy or a new trust policy for a registry", Long: setTrustDescription, @@ -32,7 +33,6 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode}, Command: setTrustCommand, Parent: trustCmd, }) diff --git a/cmd/podman/images/trust_show.go b/cmd/podman/images/trust_show.go index ed9aecdb7..5d9376068 100644 --- a/cmd/podman/images/trust_show.go +++ b/cmd/podman/images/trust_show.go @@ -15,6 +15,7 @@ import ( var ( showTrustDescription = "Display trust policy for the system" showTrustCommand = &cobra.Command{ + Annotations: map[string]string{registry.EngineMode: registry.ABIMode}, Use: "show [options] [REGISTRY]", Short: "Display trust policy for the system", Long: showTrustDescription, @@ -31,7 +32,6 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode}, Command: showTrustCommand, Parent: trustCmd, }) diff --git a/cmd/podman/images/unmount.go b/cmd/podman/images/unmount.go index 1e890c292..f72268ea2 100644 --- a/cmd/podman/images/unmount.go +++ b/cmd/podman/images/unmount.go @@ -20,6 +20,7 @@ var ( An unmount can be forced with the --force flag. ` unmountCommand = &cobra.Command{ + Annotations: map[string]string{registry.EngineMode: registry.ABIMode}, Use: "unmount [options] IMAGE [IMAGE...]", Aliases: []string{"umount"}, Short: "Unmount an image's root filesystem", @@ -43,7 +44,6 @@ func unmountFlags(flags *pflag.FlagSet) { func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode}, Parent: imageCmd, Command: unmountCommand, }) diff --git a/cmd/podman/images/untag.go b/cmd/podman/images/untag.go index 4344e1847..4c1862242 100644 --- a/cmd/podman/images/untag.go +++ b/cmd/podman/images/untag.go @@ -8,27 +8,25 @@ import ( ) var ( - untagCommand = &cobra.Command{ - Use: "untag IMAGE [IMAGE...]", - Short: "Remove a name from a local image", - Long: "Removes one or more names from a locally-stored image.", - RunE: untag, - Args: cobra.MinimumNArgs(1), - DisableFlagsInUseLine: true, - ValidArgsFunction: common.AutocompleteImages, + untagCmd = &cobra.Command{ + Use: "untag IMAGE [IMAGE...]", + Short: "Remove a name from a local image", + Long: "Removes one or more names from a locally-stored image.", + RunE: untag, + Args: cobra.MinimumNArgs(1), + ValidArgsFunction: common.AutocompleteImages, Example: `podman untag 0e3bbc2 podman untag imageID:latest otherImageName:latest podman untag httpd myregistryhost:5000/fedora/httpd:v2`, } - imageUntagCommand = &cobra.Command{ - Args: untagCommand.Args, - DisableFlagsInUseLine: true, - Use: untagCommand.Use, - Short: untagCommand.Short, - Long: untagCommand.Long, - RunE: untagCommand.RunE, - ValidArgsFunction: untagCommand.ValidArgsFunction, + imageUntagCmd = &cobra.Command{ + Args: untagCmd.Args, + Use: untagCmd.Use, + Short: untagCmd.Short, + Long: untagCmd.Long, + RunE: untagCmd.RunE, + ValidArgsFunction: untagCmd.ValidArgsFunction, Example: `podman image untag 0e3bbc2 podman image untag imageID:latest otherImageName:latest podman image untag httpd myregistryhost:5000/fedora/httpd:v2`, @@ -37,12 +35,10 @@ var ( func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, - Command: untagCommand, + Command: untagCmd, }) registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, - Command: imageUntagCommand, + Command: imageUntagCmd, Parent: imageCmd, }) } |