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

The CatalogSource file created by oc-mirror for v2 format is invalid

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Critical Critical
    • 4.16
    • 4.16
    • oc-mirror
    • 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:

      when I used the file to create CatalogSource, the creation failed and hit error:
      [root@preserve-fedora36 cluster-resources]# oc create -f cs-redhat-operator-index-v4-15.yaml 
      The CatalogSource "cs-redhat-operator-index-v4-15" is invalid: 
      * spec.icon.base64data: Required value
      * spec.icon.mediatype: Required value
      [root@preserve-fedora36 cluster-resources]# cat cs-redhat-operator-index-v4-15.yaml 
      apiVersion: operators.coreos.com/v1alpha1
      kind: CatalogSource
      metadata:
        creationTimestamp: null
        name: cs-redhat-operator-index-v4-15
        namespace: openshift-marketplace
      spec:
        icon: {}
        image: ec2-3-144-93-237.us-east-2.compute.amazonaws.com:5000/redhat/redhat-operator-index:v4.15
        sourceType: grpc
      status: {}
      

       

       

      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-202403070215.p0.gc4f8295.assembly.stream.el9-c4f8295", GitCommit:"c4f829512107f7d0f52a057cd429de2030b9b3b3", GitTreeState:"clean", BuildDate:"2024-03-07T03:46:24Z", 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 imagesetconfigure to mirror to localhost:
      cat config.yaml 
      kind: ImageSetConfiguration
      apiVersion: mirror.openshift.io/v1alpha2
      #archiveSize: 8
      storageConfig:
        local:
          path: /app1/ocmirror/offline
      mirror:
        platform:
          channels:
          - name: stable-4.12                                             
            type: ocp
            minVersion: '4.12.46'
            maxVersion: '4.12.46'
            shortestPath: true
          graph: true
        operators:
        - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.15
          packages:
          - name: advanced-cluster-management                                  
            channels:
            - name: release-2.9             
          - name: compliance-operator
            channels:
            - name: stable
          - name: multicluster-engine
            channels:
            - name: stable-2.4
            - name: stable-2.5
        additionalImages:
        - name: registry.redhat.io/ubi8/ubi:latest                        
        - name: registry.redhat.io/rhel8/support-tools:latest
        - name: registry.access.redhat.com/ubi8/nginx-120:latest
        - name: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.8.0
        - name: registry.k8s.io/sig-storage/csi-resizer:v1.8.0
      `oc-mirror --config config.yaml  file://operatortest --v2`
      2. mirror to registry :
      `oc-mirror  --config config.yaml --from file://operatortest   docker://ec2-3-144-93-237.us-east-2.compute.amazonaws.com:5000  --v2`
      
      3. Create catalogsource with the created file:
      cat cs-redhat-operator-index-v4-15.yaml 
      apiVersion: operators.coreos.com/v1alpha1
      kind: CatalogSource
      metadata:
        creationTimestamp: null
        name: cs-redhat-operator-index-v4-15
        namespace: openshift-marketplace
      spec:
        icon: {}
        image: ec2-3-144-93-237.us-east-2.compute.amazonaws.com:5000/redhat/redhat-operator-index:v4.15
        sourceType: grpc
      status: {}
      
      oc create -f cs-redhat-operator-index-v4-15.yaml 
      The CatalogSource "cs-redhat-operator-index-v4-15" is invalid: 
      * spec.icon.base64data: Required value
      * spec.icon.mediatype: Required value

      Actual results: 

      Failed to create catalogsource by the created file.
      

      Expected results:

      No error.

            [OCPBUGS-31024] The CatalogSource file created by oc-mirror for v2 format is invalid

            Since the problem described in this issue should be resolved in a recent advisory, it has been closed.

            For information on the advisory (Critical: OpenShift Container Platform 4.16.0 bug fix and security update), and where to find the updated files, follow the link below.

            If the solution does not work for you, open a new bug report.
            https://access.redhat.com/errata/RHSA-2024:0041

            Errata Tool added a comment - Since the problem described in this issue should be resolved in a recent advisory, it has been closed. For information on the advisory (Critical: OpenShift Container Platform 4.16.0 bug fix and security update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2024:0041

            Ying Zhou added a comment -
            [root@preserve-fedora36 0416]# oc create -f out/working-dir/cluster-resources/cs-redhat-marketplace-index-v14.yaml
            catalogsource.operators.coreos.com/cs-redhat-marketplace-index-v14 created
            [root@preserve-fedora36 0416]# cat out/working-dir/cluster-resources/cs-redhat-marketplace-index-v14.yaml
            apiVersion: operators.coreos.com/v1alpha1
            kind: CatalogSource
            metadata:
              name: cs-redhat-marketplace-index-v14
              namespace: openshift-marketplace
            spec:
              image: yinzhou-422.mirror-registry.qe.gcp.devcluster.openshift.com:5000/yinzhou/redhat-marketplace-index:v14
              sourceType: grpc
            status: {}
            [root@preserve-fedora36 0416]# oc get pod -n openshift-marketplace 
            NAME                                    READY   STATUS    RESTARTS        AGE
            cs-redhat-marketplace-index-v14-6j42q   1/1     Running   0               57s
            marketplace-operator-64cfc6c556-tvk4d   1/1     Running   4 (3h47m ago)   4h6m
            qe-app-registry-xkmmc                   1/1     Running   0               3h27m
            [root@preserve-fedora36 0416]# 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-202404191609.p0.g9ac063b.assembly.stream.el9-9ac063b", GitCommit:"9ac063b0b88466183a50287af277c5ed40a8e238", GitTreeState:"clean", BuildDate:"2024-04-19T22:03:51Z", GoVersion:"go1.21.7 (Red Hat 1.21.7-1.el9) X:strictfipsruntime", Compiler:"gc", Platform:"linux/amd64"} 

            Ying Zhou added a comment - [root@preserve-fedora36 0416]# oc create -f out/working-dir/cluster-resources/cs-redhat-marketplace-index-v14.yaml catalogsource.operators.coreos.com/cs-redhat-marketplace-index-v14 created [root@preserve-fedora36 0416]# cat out/working-dir/cluster-resources/cs-redhat-marketplace-index-v14.yaml apiVersion: operators.coreos.com/v1alpha1 kind: CatalogSource metadata:   name: cs-redhat-marketplace-index-v14   namespace: openshift-marketplace spec:   image: yinzhou-422.mirror-registry.qe.gcp.devcluster.openshift.com:5000/yinzhou/redhat-marketplace-index:v14   sourceType: grpc status: {} [root@preserve-fedora36 0416]# oc get pod -n openshift-marketplace  NAME                                    READY   STATUS    RESTARTS        AGE cs-redhat-marketplace-index-v14-6j42q   1/1     Running   0               57s marketplace- operator -64cfc6c556-tvk4d   1/1     Running   4 (3h47m ago)   4h6m qe-app-registry-xkmmc                   1/1     Running   0               3h27m [root@preserve-fedora36 0416]# 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-202404191609.p0.g9ac063b.assembly.stream.el9-9ac063b ", GitCommit:" 9ac063b0b88466183a50287af277c5ed40a8e238 ", GitTreeState:" clean ", BuildDate:" 2024-04-19T22:03:51Z ", GoVersion:" go1.21.7 (Red Hat 1.21.7-1.el9) X:strictfipsruntime ", Compiler :" gc ", Platform:" linux/amd64"}

            Tested with steps as described in the `steps to reproduce` and with the fixed PR i am able to create a `catalogSource` in the cluster.

            [fedora@preserve-fedora36 app1]$ ./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:"v0.2.0-alpha.1-223-gc8cedde", GitCommit:"c8ceddea", GitTreeState:"clean", BuildDate:"2024-04-05T10:49:02Z", GoVersion:"go1.21.8", Compiler:"gc", Platform:"linux/amd64"}

            New catalogSource does not have empty `icon` included:

            apiVersion: operators.coreos.com/v1alpha1
            kind: CatalogSource
            metadata:
            creationTimestamp: null
            name: cs-redhat-operator-index-v4-15
            namespace: openshift-marketplace
            spec:
            image: ec2-3-138-119-88.us-east-2.compute.amazonaws.com:5000/redhat/redhat-operator-index:v4.15
            sourceType: grpc
            status: {}

            [knarra@knarra-thinkpadx1carbon7th openshift-tests-private]$ oc create -f /tmp/catalogsource.yaml
            catalogsource.operators.coreos.com/cs-redhat-operator-index-v4-15 created
            [knarra@knarra-thinkpadx1carbon7th openshift-tests-private]$ oc get pods -n openshift-marketplace
            NAME READY STATUS RESTARTS AGE
            cs-redhat-operator-index-v4-15-lmg4l 0/1 ContainerCreating 0 9s

            [knarra@knarra-thinkpadx1carbon7th openshift-tests-private]$ oc get pods -n openshift-marketplace
            NAME READY STATUS RESTARTS AGE
            cs-redhat-operator-index-v4-15-jxlgn 1/1 Running 0 37s

            Rama Kasturi Narra added a comment - Tested with steps as described in the `steps to reproduce` and with the fixed PR i am able to create a `catalogSource` in the cluster. [fedora@preserve-fedora36 app1] $ ./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:"v0.2.0-alpha.1-223-gc8cedde", GitCommit:"c8ceddea", GitTreeState:"clean", BuildDate:"2024-04-05T10:49:02Z", GoVersion:"go1.21.8", Compiler:"gc", Platform:"linux/amd64"} New catalogSource does not have empty `icon` included: apiVersion: operators.coreos.com/v1alpha1 kind: CatalogSource metadata: creationTimestamp: null name: cs-redhat-operator-index-v4-15 namespace: openshift-marketplace spec: image: ec2-3-138-119-88.us-east-2.compute.amazonaws.com:5000/redhat/redhat-operator-index:v4.15 sourceType: grpc status: {} [knarra@knarra-thinkpadx1carbon7th openshift-tests-private] $ oc create -f /tmp/catalogsource.yaml catalogsource.operators.coreos.com/cs-redhat-operator-index-v4-15 created [knarra@knarra-thinkpadx1carbon7th openshift-tests-private] $ oc get pods -n openshift-marketplace NAME READY STATUS RESTARTS AGE cs-redhat-operator-index-v4-15-lmg4l 0/1 ContainerCreating 0 9s [knarra@knarra-thinkpadx1carbon7th openshift-tests-private] $ oc get pods -n openshift-marketplace NAME READY STATUS RESTARTS AGE cs-redhat-operator-index-v4-15-jxlgn 1/1 Running 0 37s

              skhoury@redhat.com Sherine Khoury
              yinzhou@redhat.com Ying Zhou
              Rama Kasturi Narra Rama Kasturi Narra
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: