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

It should deny creating an ImageDigestMirrorSet with conflicting mirrorSourcePolicy

XMLWordPrintable

    • Moderate
    • No
    • False
    • Hide

      None

      Show
      None
    • Release Note Not Required
    • In Progress

      This is a clone of issue OCPBUGS-27190. The following is the description of the original issue:

      Description of problem:

      When creating an ImageDigestMirrorSet with conflicting mirrorSourcePolicy, it didn't prompt error.

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

      % oc get clusterversion 
      NAME      VERSION                              AVAILABLE   PROGRESSING   SINCE   STATUS
      version   4.15.0-0.nightly-2024-01-14-100410   True        False         27m     Cluster version is 4.15.0-0.nightly-2024-01-14-100410
      

      How reproducible:

      always

      Steps to Reproduce:

      1. create an ImageContentSourcePolicy 
      
      ImageContentSourcePolicy.yaml:
      apiVersion: operator.openshift.io/v1alpha1
      kind: ImageContentSourcePolicy
      metadata:
        name: ubi8repo
      spec:
        repositoryDigestMirrors:
        - mirrors:
          - example.io/example/ubi-minimal
          - example.com/example/ubi-minimal
          source: registry.access.redhat.com/ubi6/ubi-minimal
        - mirrors:
          - mirror.example.net
          source: registry.example.com/example
      
      2.After the mcp finish updating, check the /etc/containers/registries.conf update as expected
      
      3.create an ImageDigestMirrorSet with conflicting mirrorSourcePolicy for the same source "registry.example.com/example"
      
      ImageDigestMirrorSet-conflict.yaml: 
      apiVersion: config.openshift.io/v1
      kind: ImageDigestMirrorSet
      metadata:
        name: digest-mirror
      spec:
        imageDigestMirrors:
        - mirrors:
          - example.io/example/ubi-minimal
          - example.com/example/ubi-minimal
          source: registry.access.redhat.com/ubi8/ubi-minimal
          mirrorSourcePolicy: AllowContactingSource
        - mirrors:
          - mirror.example.net
          source: registry.example.com/example
          mirrorSourcePolicy: NeverContactSource
         

      Actual results:

      3. create successfully, but the mcp didn't get updated and no relevant mc generated.
      
      The machine-config-controller log showed:
      I0116 02:34:03.897335       1 container_runtime_config_controller.go:417] Error syncing image config openshift-config: could not Create/Update MachineConfig: could not update registries config with new changes: conflicting mirrorSourcePolicy is set for the same source "registry.example.com/example" in imagedigestmirrorsets and/or imagetagmirrorsets
      

      Expected results:

      3. it should prompt: there exist conflicting mirrorSourcePolicy for the same source "registry.example.com/example" in ICSP  

      Additional info:

          

              qiwan233 Qi Wang
              openshift-crt-jira-prow OpenShift Prow Bot
              Min Li Min Li
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: