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

`--image-generation Gen1` set not work even without marketplace flags

    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None
    • None
    • Done
    • Bug Fix
    • Hide
      Before this update, the CLI's `GenerateNodePools()` function incorrectly set `AzureMarketplace` to nil when you specified the `--image-generation` flag without additional marketplace flags, which discarded your preference. Also, the `nodepool` controller failed to set `ImageGeneration` when creating images from the release payload, which caused them to default to Gen2. As a consequence, when users attempted to create Azure hosted clusters using `--image-generation` Gen1, the `NodePools` were incorrectly provisioned with Gen2 images, which ignored the explicit configuration. With this release, the CLI is modified to preserve your preference by creating a proper `AzureMarketplaceImage` structure, and the `nodepool` controller explicitly sets the generation field based on the release payload (mapping Gen1 for HyperVGen1 and Gen2 for HyperVGen2). As a result, the` --image-generation` flag is now fully respected, which allows you to successfully deploy `NodePools` with their chosen image generation without being overwritten by system defaults. (link:https://issues.redhat.com/browse/OCPBUGS-63613[OCPBUGS-63613])
      Show
      Before this update, the CLI's `GenerateNodePools()` function incorrectly set `AzureMarketplace` to nil when you specified the `--image-generation` flag without additional marketplace flags, which discarded your preference. Also, the `nodepool` controller failed to set `ImageGeneration` when creating images from the release payload, which caused them to default to Gen2. As a consequence, when users attempted to create Azure hosted clusters using `--image-generation` Gen1, the `NodePools` were incorrectly provisioned with Gen2 images, which ignored the explicit configuration. With this release, the CLI is modified to preserve your preference by creating a proper `AzureMarketplaceImage` structure, and the `nodepool` controller explicitly sets the generation field based on the release payload (mapping Gen1 for HyperVGen1 and Gen2 for HyperVGen2). As a result, the` --image-generation` flag is now fully respected, which allows you to successfully deploy `NodePools` with their chosen image generation without being overwritten by system defaults. (link: https://issues.redhat.com/browse/OCPBUGS-63613 [ OCPBUGS-63613 ])
    • None
    • None
    • None
    • None

      Description of problem:

      When create the HostedCluster and set image-generation==Gen1 without marketplace flags, the new created hosted cluster still use 'Gen2'. 

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

      4.21, 4.20
          

      How reproducible:

      always
          

      Steps to Reproduce:

       1. Clone latest hypershift repo and build hypershift client and operators images;
       2. with 4.21 nightly build and image-generation as 'Gen1' to create the hosted cluster : 
      
       echo ${RELEASE_IMAGE}
      registry.ci.openshift.org/ocp/release:4.21.0-0.nightly-2025-10-27-085201
      
      ./hypershift create cluster azure     --name "$CLUSTER_NAME" \
         --namespace "$CLUSTER_NAMESPACE"  \
         --azure-creds $AZURE_CREDS \
         --location ${LOCATION} \
         --node-pool-replicas 2 \
         --base-domain $PARENT_DNS_ZONE \
         --pull-secret $PULL_SECRET \
         --generate-ssh \
         --release-image ${RELEASE_IMAGE} \
         --external-dns-domain ${DNS_ZONE_NAME} \
         --resource-group-name "${MANAGED_RG_NAME}" \
         --vnet-id "${GetVnetID}" \
         --subnet-id "${GetSubnetID}" \
         --network-security-group-id "${GetNsgID}" \
         --sa-token-issuer-private-key-path "${SA_TOKEN_ISSUER_PRIVATE_KEY_PATH}" \
         --oidc-issuer-url "${OIDC_ISSUER_URL}" \
         --dns-zone-rg-name ${PERSISTENT_RG_NAME}  \
         --assign-service-principal-roles  \
         --workload-identities-file ./workload-identities.json  \
         --diagnostics-storage-account-type Managed \
         --control-plane-operator-image=quay.io/zhouying7780/hypershift-control-plane:latest        \
         --image-generation Gen1

      Actual results:

      1. ./hypershift -v 
      hypershift version openshift/hypershift: 7a63e46b0d154786852592eb5a01a79b82df0afe. Latest supported OCP: 4.21.0
      
      git log 7a63e46b0d154786852592eb5a01a79b82df0afe |grep "#6904"
          Merge pull request #6904 from bryan-cox/CNTRLPLANE-475
      
      2.The new created hosted cluster still set as 'Gen2':
      
      oc get np yinzhou-hc-sm   -n clusters -o jsonpath='{.spec.platform.azure}' |json_reformat
      {
          "diagnostics": {
              "storageAccountType": "Managed"
          },
          "encryptionAtHost": "Enabled",
          "image": {
              "azureMarketplace": {
                  "imageGeneration": "Gen2",
                  "offer": "aro4",
                  "publisher": "azureopenshift",
                  "sku": "419-v2",
                  "version": "419.6.20250523"
              },
              "type": "AzureMarketplace"
          },
          "osDisk": {
              "diskStorageAccountType": "Premium_LRS",
              "sizeGiB": 120
          },
          "subnetID": "/subscriptions/53b8f551-f0fc-4bea-8cba-6d1fefd54c8a/resourceGroups/yinzhou-customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/yinzhou-customer-vnet/subnets/yinzhou-customer-subnet-1",
          "vmSize": "Standard_D4s_v3"
      }
      
      

      Expected results:

      The hosted cluster should be "imageGeneration": "Gen1"

      Additional info:

          

              rh-ee-brcox Bryan Cox
              yinzhou@redhat.com Ying Zhou
              None
              None
              Ying Zhou Ying Zhou
              None
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: