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

Catalogs should not be included in the ImageContentSourcePolicy.yaml

XMLWordPrintable

    • No
    • CFE Sprint 234
    • 1
    • Proposed
    • False
    • Hide

      None

      Show
      None
    • Hide
      Previously, oc-mirror would incorrectly add the Operator catalog to `ImageContentSourcePolicy`. This is an unexpected behavior because the Operator catalog is directly used from the destination registry through `CatalogSource`. This bug is fixed by ensuring that the oc-mirror does not add the Operator catalog as an entry to 'ImageContentSourcePolicy'.
      Show
      Previously, oc-mirror would incorrectly add the Operator catalog to `ImageContentSourcePolicy`. This is an unexpected behavior because the Operator catalog is directly used from the destination registry through `CatalogSource`. This bug is fixed by ensuring that the oc-mirror does not add the Operator catalog as an entry to 'ImageContentSourcePolicy'.
    • Bug Fix
    • Done

      Description of problem:

      Currently when the oc-mirror command runs the generated ImageContentSourcePolicy.yaml should not include mirrors for the mirrored operator catalogs
      

      This should be the case for registry located catalogs and oci fbc catalogs (located on disk)
      jpower_personal, lfrfla can you help us confirm this is the expected behavior?

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

      4.13

      How reproducible:

      Always

      Steps to Reproduce:

      1.Run the oc mirror command mirroring the catalog
      /bin/oc-mirror --config imageSetConfig.yaml  docker://localhost:5000  --use-oci-feature  --dest-use-http  --dest-skip-tls
      with imagesetconfig:
      kind: ImageSetConfiguration
      apiVersion: mirror.openshift.io/v1alpha2
      storageConfig:
        local:
          path: /tmp/storageBackend
      mirror:
        operators:
        - catalog: oci:///home/user/catalogs/rhop4.12
          # copied from registry.redhat.io/redhat/redhat-operator-index:v4.12
          targetCatalog: "mno/redhat-operator-index"
          targetVersion: "v4.12"
          packages:
          - name: aws-load-balancer-operator
      

      Actual results:

      Catalog is included in the imageContentSourcePolicy.yaml
      apiVersion: operators.coreos.com/v1alpha1
      kind: CatalogSource
      metadata:
        name: redhat-operator-index
        namespace: openshift-marketplace
      spec:
        image: localhost:5000/mno/redhat-operator-index:v4.12
        sourceType: grpc
      
      ---
      apiVersion: operator.openshift.io/v1alpha1
      kind: ImageContentSourcePolicy
      metadata:
        labels:
          operators.openshift.org/catalog: "true"
        name: operator-0
      spec:
        repositoryDigestMirrors:
        - mirrors:
          - localhost:5000/albo
          source: registry.redhat.io/albo
        - mirrors:
          - localhost:5000/mno
          source: mno
        - mirrors:
          - localhost:5000/openshift4
          source: registry.redhat.io/openshift4
      

      Expected results:

      No catalog should be included in the imageContentSourcePolicy.yaml
      apiVersion: operators.coreos.com/v1alpha1
      kind: CatalogSource
      metadata:
        name: redhat-operator-index
        namespace: openshift-marketplace
      spec:
        image: localhost:5000/mno/redhat-operator-index:v4.12
        sourceType: grpc
      
      ---
      apiVersion: operator.openshift.io/v1alpha1
      kind: ImageContentSourcePolicy
      metadata:
        labels:
          operators.openshift.org/catalog: "true"
        name: operator-0
      spec:
        repositoryDigestMirrors:
        - mirrors:
          - localhost:5000/albo
          source: registry.redhat.io/albo
        - mirrors:
          - localhost:5000/openshift4
          source: registry.redhat.io/openshift4
      

      Additional info:

       

            rh-ee-aguidi Alex Guidi
            rh-ee-aguidi Alex Guidi
            ying zhou ying zhou
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: