Bug 2047331

Summary: global pull secret not working in OCP4.7.4+ for additional private registries
Product: OpenShift Container Platform Reporter: OpenShift BugZilla Robot <openshift-bugzilla-robot>
Component: ImageStreamsAssignee: Nichita Gutu <ngutu>
Status: CLOSED ERRATA QA Contact: XiuJuan Wang <xiuwang>
Severity: high Docs Contact:
Priority: high    
Version: 4.7CC: aos-bugs, jseunghw, ngutu, oarribas, obulatov, qiwan, skrenger, wking
Target Milestone: ---   
Target Release: 4.9.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-02-14 12:00:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1984592    
Bug Blocks: 2052097    

Comment 1 XiuJuan Wang 2022-01-28 08:49:15 UTC
Verified this bug from pr https://github.com/openshift/cluster-openshift-apiserver-operator/pull/491 version 
1. export the current secret 
$ oc get secret/pull-secret -n openshift-config --template='{{index .data ".dockerconfigjson" | base64decode}}' >pullsecret.orig
2. $ cp pullsecret.orig pull.json
3. Modify registry+secret to pull.json
4. reimport the secret
$ oc set data secret/pull-secret -n openshift-config --from-file=.dockerconfigjson=./pull.json
5. wait for roll out and veryfy, e.g. via 
$ for node in `oc get no |awk -F " " '/Ready/ {print $1}'`; do oc debug node/$node -- chroot /host cat /var/lib/kubelet/config.json;done
6. Diff the secret, the secret are same
$ oc -n openshift-apiserver rsh apiserver-XXXXnnnn-xxxx cat /var/lib/kubelet/config.json | jq '.auths."registry.redhat.io".auth'  > apipod-pullsecret
$ diff pull.json apipod-pullsecret
Import a image from the private registry, imported successfully.

Comment 6 errata-xmlrpc 2022-02-14 12:00:57 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.9.21 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:0488