mirror of
https://github.com/containers/podman.git
synced 2025-10-25 02:04:43 +08:00
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:
@ -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(
|
||||
|
||||
@ -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()
|
||||
|
||||
Reference in New Issue
Block a user