Bug 1712496

Summary: imagestream's referencePolicy field should be set to Source when openshift_hosted_manage_registry is set to false
Product: OpenShift Container Platform Reporter: Joel Rosental R. <jrosenta>
Component: InstallerAssignee: Joseph Callen <jcallen>
Installer sub component: openshift-ansible QA Contact: Gaoyun Pei <gpei>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: gpei, jcallen, sponnaga
Version: 3.11.0   
Target Milestone: ---   
Target Release: 3.11.z   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: The openshift project's ImageStreams is not modified in the case of a hosted managed registry is false Consequence: The ImageStreams fail if not using hosted managed registry Fix: Read and modify the resulting dictionary to set referencePolicy to source Result: The imagestreams can be used without a hosted managed registry
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-23 19:56:23 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 Joel Rosental R. 2019-05-21 15:50:52 UTC
Description of problem:
By default OCP image registry is deployed as well as image pullthrough. However, when "openshift_hosted_manage_registry" is set to false because an external image registry is going to be used instead, then referencePolicy field on imagestream objects should be set to "Source" instead.

Currently when OCP is installed this is not altered, and it has to be modified manually as follows:

oc get is postgresql --export -o yaml -n openshift > is-postgresql.yaml
sed 's/Local/Source/' is-postgresql.yaml > is-postgresql-modified.yaml
oc delete is postgresql -n openshift
oc create -f is-postgresql-modified.yaml -n openshift


Version-Release number of the following components:
$ rpm -q openshift-ansible
openshift-ansible-3.11.92-1.git.0.f2fade7.el7.noarch

$ ansible-2.6.15-1.el7ae.noarch
rpm -q ansible

$ ansible --version
ansible 2.6.15

How reproducible:
Always

Steps to Reproduce:
1. Set openshift_hosted_manage_registry=false in the ansible inventory file
2. Install OCP


Actual results:
referencePolicy field on imagestream objects definition is set to "Local" instead of "Source"

Expected results:
It should be set to "Source" instead.

Additional info:

Comment 1 Joseph Callen 2019-05-31 19:31:40 UTC
PR: https://github.com/openshift/openshift-ansible/pull/11653

Comment 3 Gaoyun Pei 2019-07-11 10:03:59 UTC
Verify this bug with openshift-ansible-3.11.129-1.git.0.11838de.el7.noarch.rpm,
when openshift_hosted_manage_registry=false set in ansible inventory file, referencePolicy field is set to "Source"
[root@ip-172-18-9-149 ~]# oc get is postgresql --export -o yaml -n openshift |grep referencePolicy -A 1
    referencePolicy:
      type: Source
--
    referencePolicy:
      type: Source
--
    referencePolicy:
      type: Source
--
    referencePolicy:
      type: Source
--
    referencePolicy:
      type: Source
--
    referencePolicy:
      type: Source

In previous openshift-ansible installer - openshift-ansible-3.11.107-1.git.0.c5a8069.el7.noarch.rpm, it was like:
[root@ip-172-18-3-101 ~]# oc get is postgresql --export -o yaml -n openshift |grep referencePolicy -A 1
    referencePolicy:
      type: Local
--
    referencePolicy:
      type: Local
--
    referencePolicy:
      type: Local
--
    referencePolicy:
      type: Local
--
    referencePolicy:
      type: Local
--
    referencePolicy:
      type: Local

Comment 5 errata-xmlrpc 2019-07-23 19:56:23 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:1753