Bug 1670483

Summary: The openshift_master_image_policy_allowed_registries_for_import variable has not valid values in the file /usr/share/doc/openshift-ansible-docs-3.11.59/docs/example-inventories/hosts.example
Product: OpenShift Container Platform Reporter: Oscar Casal Sanchez <ocasalsa>
Component: DocumentationAssignee: Vikram Goyal <vigoyal>
Status: CLOSED NOTABUG QA Contact: Wenjing Zheng <wzheng>
Severity: unspecified Docs Contact: Vikram Goyal <vigoyal>
Priority: unspecified    
Version: 3.11.0CC: aos-bugs, jokerman, klaas, lmartinh, mmccomas, rsandu, wsun
Target Milestone: ---   
Target Release: ---   
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: 2020-03-31 06:43:17 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 Oscar Casal Sanchez 2019-01-29 16:12:38 UTC
Document URL: https://github.com/openshift/openshift-ansible/blob/release-3.11/inventory/hosts.example

Package: openshift-ansible-docs-3.11.59-1.git.0.ba8e948.el7.noarch

Describe the issue: 

The hosts.example delivered with the package openshift-ansible-docs-3.11.59-1.git.0.ba8e948.el7.noarch in the path /usr/share/doc/openshift-ansible-docs-3.11.59/docs/example-inventories/hosts.example contains the next variable:

openshift_master_image_policy_allowed_registries_for_import=["docker.io", "*.docker.io", "*.redhat.com", "gcr.io", "quay.io", "registry.centos.org", "registry.redhat.io", "*.amazonaws.com"]

This variable is creating an invalid /etc/origin/master/master-config.yml file like this:

...
imagePolicyConfig:
  allowedRegistriesForImport:
  - docker.io
  - '*.docker.io'
  - '*.redhat.com'
  - gcr.io
  - quay.io
  - registry.centos.org
  - registry.redhat.io
  - '*.amazonaws.com'
...

When it should be something like this:

imagePolicyConfig:
  imagePolicyConfig:
    allowedRegistriesForImport:
    - domainName: docker.io
    - domainName: '*.docker.io'
    - domainName: '*.redhat.com'
    - ...
... 

Suggestions for improvement:
############################

Change the variable:

openshift_master_image_policy_allowed_registries_for_import=["docker.io", "*.docker.io", "*.redhat.com", "gcr.io", "quay.io", "registry.centos.org", "registry.redhat.io", "*.amazonaws.com"]

by something like this:

openshift_master_image_policy_allowed_registries_for_import=[{"domainName":"docker.io"},{"domainName":"*.docker.io"},...]

Comment 1 Oscar Casal Sanchez 2019-02-04 14:06:55 UTC
Hi,

From the description of the problem, I have made a mistake with this lines:

---
When it should be something like this:

imagePolicyConfig:
  imagePolicyConfig:
    allowedRegistriesForImport:
    - domainName: docker.io
    - domainName: '*.docker.io'
    - domainName: '*.redhat.com'
    - ...
---

But it should be something like this:


---
When it should be something like this:

imagePolicyConfig:
  allowedRegistriesForImport:
  - domainName: docker.io
  - domainName: '*.docker.io'
  - domainName: '*.redhat.com'
  - ...
---

Regards,
Oscar