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

Oc-mirror create invalid format file of itms-oc-mirror.yaml when work with OCI image

XMLWordPrintable

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

      None

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

      Description of problem:

      Oc-mirror create invalid format file of itms-oc-mirror.yaml when work with OCI image, when create itms from the file, hit error : 
      
      oc create -f itms-oc-mirror.yaml 
      The ImageTagMirrorSet "itms-operator-0" is invalid: spec.imageTagMirrors[0].source: Invalid value: "//app1/noo": spec.imageTagMirrors[0].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]+)+)?)+)?$'
      
      

       

      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)  Copy the operator as OCI format to localhost:
      `skopeo copy --all docker://registry.redhat.io/redhat/redhat-operator-index:v4.15 oci:///app1/noo/redhat-operator-index --remove-signatures`
      
      2)  Use following imagesetconfigure for mirror: cat config-multi-op.yaml 
      kind: ImageSetConfiguration
      apiVersion: mirror.openshift.io/v1alpha2
      mirror:
        operators:
          - catalog: oci:///app1/noo/redhat-operator-index
            packages:
              - name: odf-operator
      `oc-mirror --config config-multi-op.yaml file://outmulitop   --v2`
      
      
      3) Do diskTomirror :
      `oc-mirror --config config-multi-op.yaml --from file://outmulitop  --v2 docker://ec2-3-139-239-15.us-east-2.compute.amazonaws.com:5000/multi`
      
      4) Create cluster resource with file: itms-oc-mirror.yaml
         `oc create -f itms-oc-mirror.yaml`

      Actual results: 

      4) failed to create ImageTagMirrorSet
      oc create -f itms-oc-mirror.yaml 
      The ImageTagMirrorSet "itms-operator-0" is invalid: spec.imageTagMirrors[0].source: Invalid value: "//app1/noo": spec.imageTagMirrors[0].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 itms-oc-mirror.yaml 
      ---
      apiVersion: config.openshift.io/v1
      kind: ImageTagMirrorSet
      metadata:
        creationTimestamp: null
        name: itms-operator-0
      spec:
        imageTagMirrors:
        - mirrors:
          - ec2-3-139-239-15.us-east-2.compute.amazonaws.com:5000/multi
          source: //app1/noo
      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: