Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace ImageContentSourcePolicy by new configuration #648

Open
fketelaars opened this issue Feb 28, 2024 · 4 comments
Open

Replace ImageContentSourcePolicy by new configuration #648

fketelaars opened this issue Feb 28, 2024 · 4 comments
Labels
finished-dev Finished development, waiting to be merged

Comments

@fketelaars
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
As from OpenShift 4.13, ImageContentSourcePolicy is deprecated: https://docs.openshift.com/container-platform/4.13/openshift_images/image-configuration.html#images-configuration-registry-mirror-convert_image-configuration

Need to change this to the new ImageDigestMirrorSet and ImageTagMirrorSet objects.

@fketelaars fketelaars added the finished-dev Finished development, waiting to be merged label Apr 27, 2024
@m-g-k
Copy link
Contributor

m-g-k commented May 13, 2024

Hi @fketelaars it looks like the version checks in automation-roles/50-install-cloud-pak/cpfs/cp-ocp-icsp/tasks/main.yml for this patch are wrong. We just ran with this on an OCP 4.12.32 cluster and it was trying to create an ImageDigestMirrorSet rather than an ImageContentSourcePolicy because of the version check failed.

All of the _p_current_ocp_version < '4.12' checks should be _p_current_ocp_version < '4.13' or you cannot install on a 4.12 cluster (4.14 would also be OK I think, as long as it's not 4.12). Once I made this change I was able bypass the error.

The full error we saw was:

7.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/cloud-user/cpd-config/fusion/status/tmp/ansible-tmp-1715615122.2915306-6353-17299247688719/ > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => changed=true
  cmd: |-
    oc apply -f /home/cloud-user/cpd-config/fusion/status/openshift/cloud-pak-idms.yaml
  delta: '0:00:01.276810'
  end: '2024-05-13 15:45:23.740366'
  invocation:
    module_args:
      _raw_params: |-
        oc apply -f /home/cloud-user/cpd-config/fusion/status/openshift/cloud-pak-idms.yaml
      _uses_shell: true
      argv: null
      chdir: null
      creates: null
      executable: null
      removes: null
      stdin: null
      stdin_add_newline: true
      strip_empty_ends: true
      warn: true
  msg: non-zero return code
  rc: 1
  start: '2024-05-13 15:45:22.463556'
  stderr: |-
    error: resource mapping not found for name: "cloud-pak-mirror" namespace: "" from "/home/cloud-user/cpd-config/fusion/status/openshift/cloud-pak-idms.yaml": no matches for kind "ImageDigestMirrorSet" in version "config.openshift.io/v1"
    ensure CRDs are installed first
  stderr_lines: <omitted>
  stdout: ''
  stdout_lines: <omitted>

It fails because 4.12 clusters do not have an ImageDigestMirrorSet CRD.

@fketelaars
Copy link
Collaborator Author

Thank you for catching this @m-g-k , fixed in fk-misc branch

fketelaars added a commit that referenced this issue May 13, 2024
@m-g-k
Copy link
Contributor

m-g-k commented May 14, 2024

Thanks for the quick patch @fketelaars ! However, I just noticed in the same file that the IDMS creation also needs changing. In this part:

include_tasks: create-idms.yml
  when: 
  - _mco_exists
  - (all_config.cp_alt_repo | default({})) == {}
  - _p_current_ocp_version >= '4.12'
- include_tasks: create-idms-alt.yml
  when: 
  - _mco_exists
  - (all_config.cp_alt_repo | default({})) != {}
  - _p_current_ocp_version >= '4.12'

The two instances of _p_current_ocp_version >= '4.12' should be _p_current_ocp_version >= '4.13'

fketelaars added a commit that referenced this issue May 14, 2024
@fketelaars
Copy link
Collaborator Author

Oops. Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
finished-dev Finished development, waiting to be merged
Projects
None yet
Development

No branches or pull requests

2 participants