diff options
author | Jhon Honce <jhonce@redhat.com> | 2020-06-22 14:29:04 -0700 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2020-07-06 14:14:53 -0400 |
commit | 8dd26289bf516dcfbd9aaad6d2dd65c9f84380c8 (patch) | |
tree | a60eae9ebbd9536d322a707bea2c760f9d94abf3 /cmd/podman/validate/latest.go | |
parent | de6a8609a81472b5be786c7404576905ebb981fb (diff) | |
download | podman-8dd26289bf516dcfbd9aaad6d2dd65c9f84380c8.tar.gz podman-8dd26289bf516dcfbd9aaad6d2dd65c9f84380c8.tar.bz2 podman-8dd26289bf516dcfbd9aaad6d2dd65c9f84380c8.zip |
Fixes --remote flag issues
* --remote, --url and --identity are now anchored to podman command.
Subcommands should no longer have issues
* TraverseChildren now set to V1 expectations
* Latest flag now has helper function. Now has consistent usage.
* IsRemote() uses cobra parser to determin if --remote is given
* Moved validation functions from parser pkg to validate pkg
*
Fixes #6598
Fixes #6704
Signed-off-by: Jhon Honce <jhonce@redhat.com>
<MH: Fixed import issues>
Signed-off-by: Matt Heon <matthew.heon@pm.me>
Diffstat (limited to 'cmd/podman/validate/latest.go')
-rw-r--r-- | cmd/podman/validate/latest.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/cmd/podman/validate/latest.go b/cmd/podman/validate/latest.go new file mode 100644 index 000000000..6e2aa063b --- /dev/null +++ b/cmd/podman/validate/latest.go @@ -0,0 +1,15 @@ +package validate + +import ( + "github.com/containers/libpod/cmd/podman/registry" + "github.com/spf13/cobra" +) + +func AddLatestFlag(cmd *cobra.Command, b *bool) { + // Initialization flag verification + cmd.Flags().BoolVarP(b, "latest", "l", false, + "Act on the latest container podman is aware of\nNot supported with the \"--remote\" flag") + if registry.IsRemote() { + _ = cmd.Flags().MarkHidden("latest") + } +} |