aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-02-21 15:21:37 -0500
committerGitHub <noreply@github.com>2022-02-21 15:21:37 -0500
commitb3963e7081d00c99a49c5bac36a94d3ed9b6655e (patch)
tree3b6e5d6c346666ba16d928535168637dc7c361a6 /cmd
parent62ff0409fafcd1980318939eed1df465bdf723a5 (diff)
parent23a7f4e0deffb075d24b3e731246269d5a35b748 (diff)
downloadpodman-b3963e7081d00c99a49c5bac36a94d3ed9b6655e.tar.gz
podman-b3963e7081d00c99a49c5bac36a94d3ed9b6655e.tar.bz2
podman-b3963e7081d00c99a49c5bac36a94d3ed9b6655e.zip
Merge pull request #13296 from Romain-Geissler-1A/url-and-connection-implies-remote
Option --url and --connection should imply --remote.
Diffstat (limited to 'cmd')
-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
}