Skip to content

Commit

Permalink
azurerm_kubernetes_* - Upgrade to go-azure-sdk (#18705)
Browse files Browse the repository at this point in the history
* `azurerm_kubernetes_*` - Upgrade to go-azure-sdk

* Make sure default values are set for ApiServerAccessProfile

ApiServerAccessProfile is not returned by default anymore

* Format maintenanceConfigTimeSpan Start/End

* Fix TestAccKubernetesCluster_upgradeSettings

* make fmt

Co-authored-by: kt <[email protected]>
  • Loading branch information
aristosvo and katbyte authored Oct 25, 2022
1 parent 6293b03 commit 4d482bd
Show file tree
Hide file tree
Showing 185 changed files with 9,576 additions and 12,222 deletions.
16 changes: 9 additions & 7 deletions internal/services/containers/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@ package client
import (
legacy "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-08-01/containerservice"
"github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry"
"github.com/Azure/azure-sdk-for-go/services/preview/containerservice/mgmt/2022-03-02-preview/containerservice"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerinstance/2021-10-01/containerinstance"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-08-02-preview/agentpools"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-08-02-preview/maintenanceconfigurations"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-08-02-preview/managedclusters"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
)

type Client struct {
AgentPoolsClient *containerservice.AgentPoolsClient
AgentPoolsClient *agentpools.AgentPoolsClient
ContainerRegistryAgentPoolsClient *containerregistry.AgentPoolsClient
ContainerInstanceClient *containerinstance.ContainerInstanceClient
KubernetesClustersClient *containerservice.ManagedClustersClient
MaintenanceConfigurationsClient *containerservice.MaintenanceConfigurationsClient
KubernetesClustersClient *managedclusters.ManagedClustersClient
MaintenanceConfigurationsClient *maintenanceconfigurations.MaintenanceConfigurationsClient
RegistriesClient *containerregistry.RegistriesClient
ReplicationsClient *containerregistry.ReplicationsClient
ServicesClient *legacy.ContainerServicesClient
Expand Down Expand Up @@ -57,13 +59,13 @@ func NewClient(o *common.ClientOptions) *Client {
o.ConfigureClient(&containerInstanceClient.Client, o.ResourceManagerAuthorizer)

// AKS
kubernetesClustersClient := containerservice.NewManagedClustersClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
kubernetesClustersClient := managedclusters.NewManagedClustersClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&kubernetesClustersClient.Client, o.ResourceManagerAuthorizer)

agentPoolsClient := containerservice.NewAgentPoolsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
agentPoolsClient := agentpools.NewAgentPoolsClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&agentPoolsClient.Client, o.ResourceManagerAuthorizer)

maintenanceConfigurationsClient := containerservice.NewMaintenanceConfigurationsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
maintenanceConfigurationsClient := maintenanceconfigurations.NewMaintenanceConfigurationsClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&maintenanceConfigurationsClient.Client, o.ResourceManagerAuthorizer)

servicesClient := legacy.NewContainerServicesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
Expand Down
Loading

0 comments on commit 4d482bd

Please sign in to comment.