diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2021-10-15 11:33:30 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2021-10-15 14:40:02 -0400 |
commit | 468e7c689b718229ed062b3daae9373f7459b6e2 (patch) | |
tree | 49b7f0c94eaf360c1612befff2f5cd5fd6b5c92f /cmd/podman/root.go | |
parent | 171f7b8975194ff9f47a3dd23adec81d11e6d104 (diff) | |
download | podman-468e7c689b718229ed062b3daae9373f7459b6e2.tar.gz podman-468e7c689b718229ed062b3daae9373f7459b6e2.tar.bz2 podman-468e7c689b718229ed062b3daae9373f7459b6e2.zip |
Move CONTAINER_HOST and _CONNECTION to IsRemote Function
Current code does not check early enough.
Follow up to https://github.com/containers/podman/pull/11978
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/root.go')
-rw-r--r-- | cmd/podman/root.go | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/cmd/podman/root.go b/cmd/podman/root.go index 734636646..6da34050e 100644 --- a/cmd/podman/root.go +++ b/cmd/podman/root.go @@ -314,15 +314,7 @@ func rootFlags(cmd *cobra.Command, opts *entities.PodmanConfig) { lFlags.StringVar(&opts.Identity, identityFlagName, ident, "path to SSH identity file, (CONTAINER_SSHKEY)") _ = cmd.RegisterFlagCompletionFunc(identityFlagName, completion.AutocompleteDefault) - remote := false - if env, ok := os.LookupEnv("CONTAINER_HOST"); ok { - logrus.Infof("CONTAINER_HOST==%q, defaulting to '--remote=true'", env) - remote = true - } else if env, ok := os.LookupEnv("CONTAINER_CONNECTION"); ok { - logrus.Infof("CONTAINER_CONNECTION==%q, defaulting to '--remote=true'", env) - remote = true - } - lFlags.BoolVarP(&opts.Remote, "remote", "r", remote, "Access remote Podman service") + lFlags.BoolVarP(&opts.Remote, "remote", "r", registry.IsRemote(), "Access remote Podman service") pFlags := cmd.PersistentFlags() if registry.IsRemote() { if err := lFlags.MarkHidden("remote"); err != nil { |