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

[Migrate to Microsoft Entra Workload ID] An uninitialized variable was used as a string constant during the extraction of the cluster's release image.

XMLWordPrintable

    • Moderate
    • No
    • Rejected
    • False
    • Hide

      None

      Show
      None
    • Release Note Not Required
    • In Progress

      Description of problem:

      While extracting the cluster's release image using the jq tool from JSON output, an uninitialized variable was mistakenly used as the version number string constant. This caused jq to fail to match any version numbers correctly, resulting in an empty extraction. Consequently, the expected image could not be extracted, resulting in an empty image.

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

          4.16

      How reproducible:

          Always.

      Steps to Reproduce:

          1.Prepare an Azure OpenShift cluster.
          2.Migration to Azure AD workload Identity using procedure https://github.com/openshift/cloud-credential-operator/blob/master/docs/azure_workload_identity.md#steps-to-in-place-migrate-an-openshift-cluster-to-azure-ad-workload-identity.
          3.Failed on step8: Extract CredentialsCrequests from the cluster's release image for the given version.

      Actual results:

      Could not extract the expected image, actually it is an empty image.
      
      $ CLUSTER_VERSION=`oc get clusterversion version -o json | jq -r '.status.desired.version'` 
      $ RELEASE_IMAGE=`oc get clusterversion version -o json | jq -r '.status.history[] | select(.version == "VERSION_FROM_PREVIOUS_COMMAND") | .image'`     

      Expected results:

      The variable should be properly initialized with the correct version number string. This ensures that jq can accurately match the version number and extract the correct image information.
      
      $ CLUSTER_VERSION=`oc get clusterversion version -o json | jq -r '.status.desired.version'`
      $ RELEASE_IMAGE=`oc get clusterversion version -o json | jq -r '.status.history[] | select(.version == "'$CLUSTER_VERSION'") | .image'`

      Additional info:

      # Obtain release image from the cluster version. Will not work with pre-release versions.
      
      $ CLUSTER_VERSION=`oc get clusterversion version -o json | jq -r '.status.desired.version'`
      
      (Error)$ oc get clusterversion version -o json | jq -r '.status.history[] | select(.version == "VERSION_FROM_PREVIOUS_COMMAND") | .image'
      
      $ oc get clusterversion version -o json | jq -r '.status.history[] | select(.version == "'$CLUSTER_VERSION'") | .image'
      registry.ci.openshift.org/ocp-arm64/release-arm64@sha256:c605269e51d60b18e6c7251c92355b783bac7f411e137da36b031a1c6f21579b
      

            jstuever@redhat.com Jeremiah Stuever
            mihuang@redhat.com Mingxia Huang
            Mingxia Huang Mingxia Huang
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: