Bug 1670483 - 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
Summary: The openshift_master_image_policy_allowed_registries_for_import variable has ...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Documentation
Version: 3.11.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Vikram Goyal
QA Contact: Wenjing Zheng
Vikram Goyal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-01-29 16:12 UTC by Oscar Casal Sanchez
Modified: 2020-03-31 06:43 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-31 06:43:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1670473 0 medium CLOSED The variable openshift_master_image_policy_allowed_registries_for_import is not being validated correctly by ansible 2021-02-22 00:41:40 UTC
Red Hat Knowledge Base (Solution) 3872871 0 None None None 2019-02-01 16:07:47 UTC

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


Note You need to log in before you can comment on or make changes to this bug.