Bug 1948538

Summary: [OCP 4.7] get-resources.sh doesn't honor the no_proxy settings
Product: OpenShift Container Platform Reporter: OpenShift BugZilla Robot <openshift-bugzilla-robot>
Component: Bare Metal Hardware ProvisioningAssignee: Riccardo Pittau <rpittau>
Bare Metal Hardware Provisioning sub component: baremetal-operator QA Contact: Silvia Serafini <sserafin>
Status: CLOSED ERRATA Docs Contact:
Severity: low    
Priority: low CC: bnemec, rpittau, vvoronko
Version: 4.7Keywords: Triaged
Target Milestone: ---   
Target Release: 4.7.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-07-14 04:47:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1948513    
Bug Blocks: 1963212    

Description OpenShift BugZilla Robot 2021-04-12 11:56:06 UTC
+++ This bug was initially created as a clone of Bug #1948513 +++

Description of problem:

In proxy environments, it is always needed to use the http_proxy, https_proxy and the no_proxy variable, otherwise if you want to reach internal resources you will be using the proxy which may not work.

The get-resources.sh script doesn't contain the no_proxy var.


Version-Release number of selected component (if applicable):
Latest


How reproducible:
Deploy a cluster with proxy settings and serving the ipa and rhcos images in a local http server with no proxy in the middle

Steps to Reproduce:
1.
2.
3.

Actual results:
The script tries to curl the images using the proxy and times out

Expected results:
The script is aware of the no_proxy variable and it downloads the images properly

Additional info:
https://github.com/metal3-io/ironic-ipa-downloader/pull/18
https://github.com/openshift/ironic-ipa-downloader/pull/65
https://github.com/openshift/ironic-rhcos-downloader/pull/39

Comment 1 Victor Voronkov 2021-06-15 05:46:48 UTC
Original https://bugzilla.redhat.com/show_bug.cgi?id=1948513 was verified, please proceed with backport

Comment 8 Silvia Serafini 2022-06-28 20:13:36 UTC
Verified on 4.7.0-0.nightly-2022-06-28-080058, cluster deployed with proxy.

[kni@provisionhost-0-0 ~]$ oc get clusterversion
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.7.0-0.nightly-2022-06-28-080058   True        False         74m     Cluster version is 4.7.0-0.nightly-2022-06-28-080058

[kni@provisionhost-0-0 ~]$  grep proxy install-config.yaml -A3
proxy:
  httpProxy: http://192.168.123.96:3128
  httpsProxy: http://192.168.123.96:3128
  noProxy: registry.ocp-edge-cluster-0.qe.lab.redhat.com,172.22.0.0/24,192.168.123.0/24,9999

[kni@provisionhost-0-0 ~]$ sudo podman ps -a
CONTAINER ID  IMAGE                     COMMAND  CREATED      STATUS          PORTS   NAMES
666cd734486a  sameersbn/squid:3.5.27-2           3 hours ago  Up 3 hours ago          squid-edge

[kni@provisionhost-0-0 ~]$  oc logs metal3-777c64bcbc-kh9nv  -n openshift-machine-api -c metal3-machine-os-downloader | grep "unset HTTP_PROXY" -B2
+ cd /shared/tmp/tmp.hHaYPCSpt2
+ clearproxy http://registry.ocp-edge-cluster-0.qe.lab.redhat.com:8080/images/rhcos-47.84.202206131038-0-openstack.x86_64.qcow2.gz
+ unset HTTP_PROXY http_proxy HTTPS_PROXY https_proxy

Comment 11 errata-xmlrpc 2022-07-14 04:47:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (OpenShift Container Platform 4.7.54 bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:5505