remote: allow --http-proxy for remote clients

The remote client should be allowed to specify if the container should
be run with the proxy env vars. It will still use the proxy vars from
the server process and not the client. This makes podman-remote more
consistent with the local version and easier to use in environments
where a proxy is required.

Fixes #16520

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2022-12-07 16:09:21 +01:00
parent 6e2e9ab227
commit 2dde30b93a
7 changed files with 21 additions and 19 deletions

View File

@ -621,7 +621,6 @@ func DefineCreateFlags(cmd *cobra.Command, cf *entities.ContainerCreateOptions,
if registry.IsRemote() {
_ = createFlags.MarkHidden("env-host")
_ = createFlags.MarkHidden("http-proxy")
_ = createFlags.MarkHidden(decryptionKeysFlagName)
} else {
createFlags.StringVar(

View File

@ -168,16 +168,7 @@ func buildFlags(cmd *cobra.Command) {
logrus.Errorf("Setting up build flags: %v", err)
os.Exit(1)
}
// --http-proxy flag
// containers.conf defaults to true but we want to force false by default for remote, since settings do not apply
if registry.IsRemote() {
flag = fromAndBudFlags.Lookup("http-proxy")
buildOpts.HTTPProxy = false
if err := flag.Value.Set("false"); err != nil {
logrus.Errorf("Unable to set --https-proxy to %v: %v", false, err)
}
flag.DefValue = "false"
}
flags.AddFlagSet(&fromAndBudFlags)
// Add the completion functions
fromAndBudFlagsCompletions := buildahCLI.GetFromAndBudFlagsCompletions()