Bug 1749341

Summary: During upgrade playbook is not respecting `openshift_docker_additional_registries` varisble
Product: OpenShift Container Platform Reporter: Abhishek <aabhishe>
Component: InstallerAssignee: Russell Teague <rteague>
Installer sub component: openshift-installer QA Contact: Gaoyun Pei <gpei>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: andreas.kurz, aos-bugs, eparis, gpei, jokerman
Version: 3.11.0   
Target Milestone: ---   
Target Release: 3.11.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Update registries.conf during upgrades Update the registries.conf file during upgrades if inventory vars are set and have been changed since install or last upgrade.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-09-24 08:08:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Abhishek 2019-09-05 12:00:49 UTC
Description of problem:
During upgrade when we add below parameter in the inventory it is not applying in the registries.conf or in docker configuration.

openshift_docker_additional_registries='docker-registry.default.svc:5000,registry.example.com'

Comment 1 Russell Teague 2019-09-06 15:13:11 UTC
The registries.conf file is only updated during the initial install when running prerequisites.yml.  However, during upgrade, the registry_auth is updated, which could lead to an issue pulling images if the registries.conf is not also updated.  We will update the upgrade playbooks to refresh the contents of registries.conf at the same time auth is updated right before docker is restarted.

Comment 4 Gaoyun Pei 2019-09-18 10:17:05 UTC
Verify this bug with openshift-ansible-3.11.146-1.git.0.fcedb45.el7.noarch.rpm

On a running 3.10 cluster, check /etc/containers/registries.conf

[registries.search]
registries = ['registry.access.redhat.com', 'docker.io', 'registry.fedoraproject.org', 'quay.io', 'registry.centos.org']


Upgrade this cluster to 3.11 with the following parameter set:
openshift_docker_additional_registries="docker-registry.default.svc:5000,registry.example.com"


During upgrade, we could see:
TASK [container_runtime : Update registries.conf] ******************************
changed: [ec2-54-81-118-40.compute-1.amazonaws.com] => {"backup_file": "/etc/containers/registries.conf.2802.2019-09-18@05:45:07~", "changed": true, "checksum": "61cd1fbade93992d737ff5b9309f87e6a3999972", "dest": "/etc/containers/registries.conf", "gid": 0, "group": "root", "md5sum": "0c0cf358b68f7646dec823545982f8f7", "mode": "0644", "owner": "root", "secontext": "system_u:object_r:etc_t:s0", "size": 1159, "src": "/root/.ansible/tmp/ansible-tmp-1568799906.71-179488685123166/source", "state": "file", "uid": 0}

check /etc/containers/registries.conf again, it's updated.

[registries.search]
registries = ["docker-registry.default.svc:5000", "registry.example.com", "docker.io"]

Comment 6 errata-xmlrpc 2019-09-24 08:08:09 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, 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-2019:2816