aboutsummaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorRomain Geissler <romain.geissler@amadeus.com>2022-02-19 13:57:20 +0000
committerRomain Geissler <romain.geissler@amadeus.com>2022-02-26 10:27:34 +0000
commitca980c2e024bd33f4be3a33bb1dbb22c86bfe072 (patch)
tree0df5b67905dbb2cfc440fb8ae880b70687cba24c /cmd/podman
parent49d511b6ee88ceff70cc6786c467bed39da35a61 (diff)
downloadpodman-ca980c2e024bd33f4be3a33bb1dbb22c86bfe072.tar.gz
podman-ca980c2e024bd33f4be3a33bb1dbb22c86bfe072.tar.bz2
podman-ca980c2e024bd33f4be3a33bb1dbb22c86bfe072.zip
Option --url and --connection should imply --remote.
Closes #13242 Signed-off-by: Romain Geissler <romain.geissler@amadeus.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/registry/remote.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/cmd/podman/registry/remote.go b/cmd/podman/registry/remote.go
index f05d8f7b4..181ef6b4a 100644
--- a/cmd/podman/registry/remote.go
+++ b/cmd/podman/registry/remote.go
@@ -30,6 +30,12 @@ func IsRemote() bool {
fs.Usage = func() {}
fs.SetInterspersed(false)
fs.BoolVarP(&remoteFromCLI.Value, "remote", "r", remote, "")
+ connectionFlagName := "connection"
+ ignoredConnection := ""
+ fs.StringVarP(&ignoredConnection, connectionFlagName, "c", "", "")
+ urlFlagName := "url"
+ ignoredURL := ""
+ fs.StringVar(&ignoredURL, urlFlagName, "", "")
// The shell completion logic will call a command called "__complete" or "__completeNoDesc"
// This command will always be the second argument
@@ -39,6 +45,8 @@ func IsRemote() bool {
start = 2
}
_ = fs.Parse(os.Args[start:])
+ // --connection or --url implies --remote
+ remoteFromCLI.Value = remoteFromCLI.Value || fs.Changed(connectionFlagName) || fs.Changed(urlFlagName)
})
return podmanOptions.EngineMode == entities.TunnelMode || remoteFromCLI.Value
}