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

HyperShift Has Usages of Azure Clients that Aren't Cloud Agnostic

XMLWordPrintable

    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • Moderate
    • No
    • None
    • None
    • None
    • In Progress
    • Bug Fix
    • Hide
      Cause: The HyperShift CLI instantiated Azure SDK clients without passing cloud configuration options, causing all clients to default to Azure Public Cloud.

      Consequence: Creating or managing hosted clusters in Azure Government Cloud or Azure China Cloud failed because the Azure SDK clients could not connect to the correct cloud endpoints.

      Fix: Added a GetAzureCloudConfiguration() helper function to convert cloud names to Azure SDK cloud configurations. Updated all Azure SDK client instantiations across 15 locations in the HyperShift CLI and control-plane-operator to use proper cloud configuration from either the --cloud CLI flag (for infrastructure commands) or HostedCluster.Spec.Platform.Azure.Cloud (for cluster commands and control-plane-operator).

      Result: The HyperShift CLI and control-plane-operator now correctly support creating and managing hosted clusters in Azure Government Cloud and Azure China Cloud in addition to Azure Public Cloud.
      Show
      Cause: The HyperShift CLI instantiated Azure SDK clients without passing cloud configuration options, causing all clients to default to Azure Public Cloud. Consequence: Creating or managing hosted clusters in Azure Government Cloud or Azure China Cloud failed because the Azure SDK clients could not connect to the correct cloud endpoints. Fix: Added a GetAzureCloudConfiguration() helper function to convert cloud names to Azure SDK cloud configurations. Updated all Azure SDK client instantiations across 15 locations in the HyperShift CLI and control-plane-operator to use proper cloud configuration from either the --cloud CLI flag (for infrastructure commands) or HostedCluster.Spec.Platform.Azure.Cloud (for cluster commands and control-plane-operator). Result: The HyperShift CLI and control-plane-operator now correctly support creating and managing hosted clusters in Azure Government Cloud and Azure China Cloud in addition to Azure Public Cloud.
    • None
    • None
    • None
    • None

      Description of problem:

      
      The hypershift cli has a bunch of usages of new clients in Azure where it doesn't pass the associated cloud you're in.  As a result, if you tried to create a hosted cluster in any cloud other than azure public cloud, it would fail. 
      
          

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

      
          

      How reproducible:

      Every time
          

      Steps to Reproduce:

          1. Try to use hypershift-cli to create hosted cluster in Azure govcloud
          2. it fails due to new clients not passing in cloud options, defaulting it to public cloud
          

      Actual results:

      Fails
          

      Expected results:

      Success
          

      Additional info:

      https://github.com/openshift/hypershift/pull/3804 introduced a Cloud parameter on the hosted cluster which can be used to create clients correctly.
      
      options need to be passed to the associated azure clients to pick the correct cloud.  
      
      Example incorrect usage of client: https://github.com/openshift/hypershift/blob/da9833da34ebc3b518a739aafe2810f8de4af709/cmd/infra/azure/create.go#L173
      
      Correct usage should set `options` instead of `nil` and correctly set the cloud as an option. 
          

              rh-ee-brcox Bryan Cox
              bvesel@redhat.com Benjamin Vesel (Inactive)
              None
              None
              Jie Zhao Jie Zhao
              None
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: