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

Invalid idms files are being generated when imageSetConfig file does not have filtering based on channels for operators when mirroring from disk2mirror

XMLWordPrintable

    • Important
    • None
    • CLID Sprint 253
    • 1
    • Rejected
    • False
    • Hide

      None

      Show
      None
    • N/A
    • Release Note Not Required
    • In Progress
    • Customer Facing

      Description of problem:

      Invalid idms files are being generated when imageSetConfig file does not have  filtering based on channels for operators when mirroring from disk2mirror  

       

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

      oc-mirror version 
      WARNING: This version information is deprecated and will be replaced with the output from --short. Use --output=yaml|json to get the full version.
      Client Version: version.Info{Major:"", Minor:"", GitVersion:"4.16.0-202403251146.p0.g03ce0ca.assembly.stream.el9-03ce0ca", GitCommit:"03ce0ca797e73b6762fd3e24100ce043199519e9", GitTreeState:"clean", BuildDate:"2024-03-25T16:34:33Z", GoVersion:"go1.21.7 (Red Hat 1.21.7-1.el9) X:strictfipsruntime", Compiler:"gc", Platform:"linux/amd64"}

      How reproducible:

      always

      Steps to Reproduce:

      1)  Use following imagesetconfig :
      cat config.yaml 
      kind: ImageSetConfiguration
      apiVersion: mirror.openshift.io/v1alpha2
      mirror:
        operators:
          - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.15
            packages:
              - name: devworkspace-operator
                minVersion: "0.23.0"
              - name: quay-operator
                maxVersion: "3.10.2"
              - name: cluster-logging
                minVersion: 5.8.3
                maxVersion: 5.8.5
      
      2)  Do mirror2Disk and disk2Mirror : 
      `oc-mirror --config config.yaml file://outnochannel --v2`
      `oc-mirror --config config.yaml --from file://outnochannel --v2 docker://ec2-3-17-164-23.us-east-2.compute.amazonaws.com:5000/default`
         
      3) Create the catalogsource, idms, itms resources
      
      

      Actual results: 

      4) failed to create ImageTagMirrorSet
      oc create -f outnochannel/working-dir/cluster-resources/idms-oc-mirror.yaml
      The ImageDigestMirrorSet "idms-operator-0" is invalid: spec.imageDigestMirrors[2].source: Invalid value: "registry.redhat.io/": spec.imageDigestMirrors[2].source in body should match '^\*(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))+$|^((?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))+)?(?::[0-9]+)?)(?:(?:/[a-z0-9]+(?:(?:(?:[._]|__|[-]*)[a-z0-9]+)+)?)+)?$'
      
      
      cat outnochannel/working-dir/cluster-resources/idms-oc-mirror.yaml
      ---
      apiVersion: config.openshift.io/v1
      kind: ImageDigestMirrorSet
      metadata:
        creationTimestamp: null
        name: idms-operator-0
      spec:
        imageDigestMirrors:
        - mirrors:
          - ec2-3-17-164-23.us-east-2.compute.amazonaws.com:5000/default/devworkspace
          source: registry.redhat.io/devworkspace
        - mirrors:
          - ec2-3-17-164-23.us-east-2.compute.amazonaws.com:5000/default/openshift4
          source: registry.redhat.io/openshift4
        - mirrors:
          - ec2-3-17-164-23.us-east-2.compute.amazonaws.com:5000/default
          source: registry.redhat.io/
        - mirrors:
          - ec2-3-17-164-23.us-east-2.compute.amazonaws.com:5000/default/quay
          source: registry.redhat.io/quay
        - mirrors:
          - ec2-3-17-164-23.us-east-2.compute.amazonaws.com:5000/default/rhel8
          source: registry.redhat.io/rhel8
        - mirrors:
          - ec2-3-17-164-23.us-east-2.compute.amazonaws.com:5000/default/openshift-logging
          source: registry.redhat.io/openshift-logging
      status: {} 

      Expected results:

      4) succeed to create the cluster resource

              skhoury@redhat.com Sherine Khoury
              yinzhou@redhat.com ying zhou
              ying zhou ying zhou
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: