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

HyperShift operator registry overrides don't apply to cluster-api and capi-provider deployments in 4.21+

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • 4.22.0
    • 4.21, 4.22
    • HyperShift
    • None
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • Important
    • Yes
    • Rejected
    • None
    • In Progress
    • Bug Fix
    • Hide
      *Cause*: This issue happens because hypershift contains temporary overrides for CAPI images that were hardcoded and not aware of registry configuration and therefore, always pulling from quay.io
      *Consequence*: CAPI images are always pulled from quay.io and registry overrides have no effect. The rest of the payload properly applies the overrides.
      *Fix*: The CAPI image override has been made aware of registry configuration and now properly follows it.
      *Result*: CAPI images are downloaded from the right registry now. For this feature to work as intended in environments where registry overrides are applied, 4.20.10 images need to be mirrored to the target registry. Otherwise CAPI images will fail to be pulled and clusters will not be created.
      Show
      *Cause*: This issue happens because hypershift contains temporary overrides for CAPI images that were hardcoded and not aware of registry configuration and therefore, always pulling from quay.io *Consequence*: CAPI images are always pulled from quay.io and registry overrides have no effect. The rest of the payload properly applies the overrides. *Fix*: The CAPI image override has been made aware of registry configuration and now properly follows it. *Result*: CAPI images are downloaded from the right registry now. For this feature to work as intended in environments where registry overrides are applied, 4.20.10 images need to be mirrored to the target registry. Otherwise CAPI images will fail to be pulled and clusters will not be created.
    • None
    • None
    • None
    • None

      Description of problem:

      When add HyperShift operator `--registry-overrides` flag to override image registries, the cluster-api and capi-provider deployments are not being overridden and continue pulling images from quay.io/openshift-release-dev/ocp-v4.0-art-dev` instead of the configured override registry. 
      All other control plane components correctly use the overridden registry. 
      This worked correctly in 4.19 and 4.20 but is broken in 4.21 and later
          

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

      
          

      How reproducible:

      always
          

      Steps to Reproduce:

          1.Deploy HyperShift on Aks
          2.Mirror OpenShift release images to ACR:
      oc adm release mirror --from $RELEASE_IMAGE_LATEST --to $ACR_REPO -a $PULL_SECRET_PATH
          3.Configure HyperShift operator with registry overrides
             oc patch deployment operator -n hypershift --type=json -p='[                                            
               {                                                                                                     
                 "op": "add",                                                                                        
                 "path": "/spec/template/spec/containers/0/args/-",                                                  
                 "value": "--registry-overrides=quay.io/openshift-release-dev/ocp-v4.0-art-dev='$ACR_REPO',quay.io   
            /openshift-release-dev/ocp-release='$ACR_REPO'"                                                            
               }                                                                                                     
             ]'
        4. Create a HostedCluster
        5. Verify deployment images in the hosted control plane namespace:
      oc get deploy -n clusters-<cluster-name> -o json | \                                                    
       jq -r '.items[] | .metadata.name + " | " + .spec.template.spec.containers[0].image'
          

      Actual results:

      [capi-provider pod yaml|https://gcsweb-qe-private-deck-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/qe-private-deck/logs/periodic-ci-openshift-openshift-tests-private-release-4.21-amd64-nightly-azure-aks-hypershift-registry-overrides-guest-f7/2011706395962904576/artifacts/azure-aks-hypershift-registry-overrides-guest-f7/dump/artifacts/namespaces/clusters-356b04e96ea8e61b0cdf/core/pods/capi-provider-866456b576-rjs4j.yaml]
      Only initContainers image has been overrided.
      [cluster-api pod yaml|https://gcsweb-qe-private-deck-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/qe-private-deck/logs/periodic-ci-openshift-openshift-tests-private-release-4.21-amd64-nightly-azure-aks-hypershift-registry-overrides-guest-f7/2011706395962904576/artifacts/azure-aks-hypershift-registry-overrides-guest-f7/dump/artifacts/namespaces/clusters-356b04e96ea8e61b0cdf/core/pods/cluster-api-898cb5d8b-4fwdf.yaml]
      
      The two deploy still use quay.io, but not overrided registry
          

      Expected results:

      All deployments in the hosted control plane namespace, including `cluster-api` and `capi-provider`, should use images from the override registry (`preservehypershiftaks.azurecr.io/release-xxxxx`).
          

      Additional info:

      
      [dump log|https://gcsweb-qe-private-deck-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/qe-private-deck/logs/periodic-ci-openshift-openshift-tests-private-release-4.21-amd64-nightly-azure-aks-hypershift-registry-overrides-guest-f7/2011706395962904576/artifacts/azure-aks-hypershift-registry-overrides-guest-f7/dump/]
          

              rh-ee-bclement Borja Clemente Castanera
              rh-ee-xiuwang XiuJuan Wang
              None
              None
              XiuJuan Wang XiuJuan Wang
              None
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated: