Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-37085

`oc adm migrate icsp` command only generates the IDMS for first ICSP in the YAML file

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Normal Normal
    • None
    • 4.15, 4.16
    • oc
    • None
    • False
    • Hide

      None

      Show
      None

      Description of problem:

       The `oc adm migrate icsp` command only generates the IDMS for first ICSP in the YAML file.

      Version-Release number of selected component (if applicable):

         4.15,4.16

      How reproducible:

          100%

      Steps to Reproduce:

      The oc-mirror command generated an imageContentSourcePolicy.yaml file after mirroring the images which has below content:
      ~~~
      ---
      apiVersion: operator.openshift.io/v1alpha1
      kind: ImageContentSourcePolicy
      metadata:
        name: generic-0
      spec:
        repositoryDigestMirrors:
        - mirrors:
          - registry.dpateriy.lab.example.com:8443/ubi8
          source: registry.redhat.io/ubi8
      ---
      apiVersion: operator.openshift.io/v1alpha1
      kind: ImageContentSourcePolicy
      metadata:
        name: release-0
      spec:
        repositoryDigestMirrors:
        - mirrors:
          - registry.dpateriy.lab.example.com:8443/openshift/release
          source: quay.io/openshift-release-dev/ocp-v4.0-art-dev
        - mirrors:
          - registry.dpateriy.lab.example.com:8443/openshift/release-images
          source: quay.io/openshift-release-dev/ocp-release
      ~~~
      
      
      When I tried running `oc adm migrate icsp` command to migrate, it only generated the IDMS for the first ICSP i.e., generic-0.
      ~~~
      $ ./oc adm migrate icsp ./oc-mirror-workspace/results-1720542158/imageContentSourcePolicy.yaml --dest-dir .
      wrote ImageDigestMirrorSet to imagedigestmirrorset_generic-0.1509966966034800745.yaml
      
      $ cat imagedigestmirrorset_generic-0.1509966966034800745.yaml
      apiVersion: config.openshift.io/v1
      kind: ImageDigestMirrorSet
      metadata:
          name: generic-0
      spec:
          imageDigestMirrors:
              - mirrors:
                  - registry.dpateriy.lab.example.com:8443/ubi8
                source: registry.redhat.io/ubi8
      ~~~

      Actual results:

         It generated the IDMS for first ICSP, it does not check the complete file for other ICSPs.

      Expected results:

          oc adm migrate icsp command should generate the IDMS for all the ICSPs defined in a single YAML file as the imageContentSourcePolicy.yaml is generated by oc-mirror itself.

      Additional info:

          

              qiwan233 Qi Wang
              rhn-support-dpateriy Divyam Pateriya
              ying zhou ying zhou
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: