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

add checkpoint for name when create catalogsouce

XMLWordPrintable

    • Important
    • None
    • Rejected
    • False
    • Hide

      None

      Show
      None
    • Previously, you could not create a `CatalogSource` resource if the name started with a number, . With this fix, by default, the `CatalogSource` resource name is generated with the `cs-` prefix and is compliant with RFC 1035.
    • Bug Fix
    • Done
    • Customer Facing

      Description of problem:

      when catalogsouce name started with number , the pod will not running well , could we add checkpoint for the name , if the name is not suitable for regex used validation  ''[a-z]([-a-z0-9]*[a-z0-9])?'')',  print message and can't create the catalogsource . 
      

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

      
      

      How reproducible:

      always 

      Steps to Reproduce:

      1.skopeo copy --all --format v2s2 docker://icr.io/cpopen/ibm-zcon-zosconnect-catalog@sha256:6f02ecef46020bcd21bdd24a01f435023d5fc3943972ef0d9769d5276e178e76 oci:///home1/611/oci-index
      2. change the work directory to :  `cd  home1/611/oci-index` 
      3. run the oc-mirror command : 
      cat config.yaml 
      kind: ImageSetConfiguration
      apiVersion: mirror.openshift.io/v1alpha2
      storageConfig:
        local:
          path: /home1/ocilocalstorage
      mirror:
        operators:
        - catalog: oci:///home1/611/oci-index
      
      `oc-mirror --config config.yaml docker://ec2-18-217-58-249.us-east-2.compute.amazonaws.com:5000/multi-oci --dest-skip-tls --include-local-oci-catalogs`
      4. apply the catalogsouce and ICSP yaml file;
      5 . check the catalogsource pod 
      
      
      

      Actual results:

      [root@preserve-fedora36 oci-index]# oc get pod --show-labels 
      NAME                                    READY   STATUS              RESTARTS   AGE     LABELS
      611-oci-index-2sfh8                     0/1     Terminating         0          4s      olm.catalogSource=611-oci-index,olm.pod-spec-hash=6b8656f87
      611-oci-index-dbj9b                     0/1     ContainerCreating   0          1s      olm.catalogSource=611-oci-index,olm.pod-spec-hash=6b8656f87
      611-oci-index-w4tfd                     0/1     Terminating         0          2s      olm.catalogSource=611-oci-index,olm.pod-spec-hash=6b8656f87
      611-oci-index-zj8nn                     0/1     Terminating         0          3s      olm.catalogSource=611-oci-index,olm.pod-spec-hash=6b8656f87
      
      oc get catalogsource 611-oci-index -oyaml 
      apiVersion: operators.coreos.com/v1alpha1
      kind: CatalogSource
      metadata:
        creationTimestamp: "2023-05-10T03:01:36Z"
        generation: 1
        name: 611-oci-index
        namespace: openshift-marketplace
        resourceVersion: "97108"
        uid: 2287434b-9e70-4865-b1a1-95997165f94e
      spec:
        image: ec2-18-217-58-249.us-east-2.compute.amazonaws.com:5000/multi-oci/home1/611/oci-index:6f02ec
        sourceType: grpc
      status:
        message: 'couldn''t ensure registry server - error ensuring service: 611-oci-index:
          Service "611-oci-index" is invalid: metadata.name: Invalid value: "611-oci-index":
          a DNS-1035 label must consist of lower case alphanumeric characters or ''-'',
          start with an alphabetic character, and end with an alphanumeric character (e.g.
          ''my-name'',  or ''abc-123'', regex used for validation is ''[a-z]([-a-z0-9]*[a-z0-9])?'')'
        reason: RegistryServerError
      
      

      Expected results:

      should not create the catalogsouce when it's name is not suitable for the regex used validation  . 
      

      Additional info:
      rename the catalogsource with oci-611-index, pod running well, and could create the operator and instance .

       

            jhunkins@redhat.com John Hunkins (Inactive)
            yinzhou@redhat.com ying zhou
            ying zhou ying zhou
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: