Skip to content

Commit 75414b5

Browse files
cfergeaupraveenkumar
authored andcommitted
Issue #1019: Fix openshift-marketplace proxy setting
The current code invokes 'oc' this way to set the proxy for the openshift-marketplace operator: oc set env deployment marketplace-operator -n openshift-marketplace \ 'HTTP_PROXY="$HTTP_PROXY", HTTPS_PROXY="$HTTPS_PROXY", NO_PROXY="$NO_PROXY"}}' This results in 'HTTP_PROXY' being set in the operator's environment with the value '"$HTTP_PROXY", HTTPS_PROXY="$HTTPS_PROXY", NO_PROXY="$NO_PROXY"}}' which is not what is intended. This prevents the openshift-marketplace operator pod from starting as it will be trying to use an invalid proxy configuration for network access and fail with: time="2020-02-13T19:31:23Z" level=fatal msg="Get https://172.30.0.1:443/api?timeout=32s: proxyconnect tcp: dial tcp: lookup \"http: no such host" This commit fixes the command used and makes it oc set env deployment marketplace-operator -n openshift-marketplace \ HTTP_PROXY=$HTTP_PROXY HTTPS_PROXY=$HTTPS_PROXY NO_PROXY=$NO_PROXY which will set the 3 environment variables as expected. This is related to #1019
1 parent f0287e2 commit 75414b5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/crc/cluster/cluster.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ Environment=NO_PROXY=.cluster.local,.svc,10.128.0.0/14,172.30.0.0/16,%s`
180180
// All other operators which have `config.openshift.io/inject-proxy` annotation get updated except marketplace.
181181
func AddProxyConfigToMarketplaceOperator(oc oc.OcConfig, proxy *network.ProxyConfig) error {
182182
cmdArgs := []string{"set", "env", "deployment", "marketplace-operator", "-n", "openshift-marketplace",
183-
fmt.Sprintf(`HTTP_PROXY="%s", HTTPS_PROXY="%s", NO_PROXY="%s"}}`, proxy.HttpProxy, proxy.HttpsProxy, proxy.GetNoProxyString()),
183+
fmt.Sprintf("HTTP_PROXY=%s", proxy.HttpProxy),
184+
fmt.Sprintf("HTTPS_PROXY=%s", proxy.HttpsProxy),
185+
fmt.Sprintf("NO_PROXY=%s", proxy.GetNoProxyString()),
184186
}
185187
if err := oc.WaitForOpenshiftResource("deployment"); err != nil {
186188
return err

0 commit comments

Comments
 (0)