Skip to content

Commit

Permalink
dependencies: updating to v0.20240213.1120950 of `github.com/hashicor…
Browse files Browse the repository at this point in the history
…p/go-azure-sdk` (hashicorp#24872)

* update go-azure-sdk to v0.20240213.1120950

* update go-azure-sdk to v0.20240213.1120950
  • Loading branch information
catriona-m authored Feb 13, 2024
1 parent 29132f9 commit e6c0652
Show file tree
Hide file tree
Showing 453 changed files with 17,427 additions and 20,069 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ require (
github.com/google/go-cmp v0.5.9
github.com/google/uuid v1.3.1
github.com/hashicorp/go-azure-helpers v0.66.2
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240212.1141705
github.com/hashicorp/go-azure-sdk/sdk v0.20240212.1141705
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240213.1120950
github.com/hashicorp/go-azure-sdk/sdk v0.20240213.1120950
github.com/hashicorp/go-hclog v1.5.0
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/go-uuid v1.0.3
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv
github.com/hashicorp/go-azure-helpers v0.12.0/go.mod h1:Zc3v4DNeX6PDdy7NljlYpnrdac1++qNW0I4U+ofGwpg=
github.com/hashicorp/go-azure-helpers v0.66.2 h1:+Pzuo7pdKl0hBXXr5ymmhs4Q40tHAo2nAvHq4WgSjx8=
github.com/hashicorp/go-azure-helpers v0.66.2/go.mod h1:kJxXrFtJKJdOEqvad8pllAe7dhP4DbN8J6sqFZe47+4=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240212.1141705 h1:qIH/cpVc/T+WzdYMrMfzws1zNPoIacnRywMvsM6YSnA=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240212.1141705/go.mod h1:8r61Qif0/pIfRzSnHa9gwsz/VzQGUjAD+VOkhPBBJyg=
github.com/hashicorp/go-azure-sdk/sdk v0.20240212.1141705 h1:AkeqkfXTenFKUI5MFwE+TGa9cUG3x9ooH2RQfJDQcqQ=
github.com/hashicorp/go-azure-sdk/sdk v0.20240212.1141705/go.mod h1:IKIPyL+hfFWBHABKT0NOWlIEzlusiUBG0SxIfaiv278=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240213.1120950 h1:7cf9ylAgm/XUdFWIr/kYSYGz0LGcoYdTDqFzRGdNcsM=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240213.1120950/go.mod h1:+DvnI11GIdnPla3R+CuTBFnrh28wBo1z4VIVPN+lspM=
github.com/hashicorp/go-azure-sdk/sdk v0.20240213.1120950 h1:u0jSAOvoRxhKlr9rISiIGFOMtB/dFQunszxLH8zwgrE=
github.com/hashicorp/go-azure-sdk/sdk v0.20240213.1120950/go.mod h1:IKIPyL+hfFWBHABKT0NOWlIEzlusiUBG0SxIfaiv278=
github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU=
github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg=
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
Expand Down
54 changes: 36 additions & 18 deletions internal/services/containers/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,17 @@ func NewContainersClient(o *common.ClientOptions) (*Client, error) {
}

// AKS
fleetUpdateStrategiesClient := fleetupdatestrategies.NewFleetUpdateStrategiesClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&fleetUpdateStrategiesClient.Client, o.ResourceManagerAuthorizer)
fleetUpdateStrategiesClient, err := fleetupdatestrategies.NewFleetUpdateStrategiesClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building Fleet Update Strategies Client: %+v", err)
}
o.Configure(fleetUpdateStrategiesClient.Client, o.Authorizers.ResourceManager)

kubernetesClustersClient := managedclusters.NewManagedClustersClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&kubernetesClustersClient.Client, o.ResourceManagerAuthorizer)
kubernetesClustersClient, err := managedclusters.NewManagedClustersClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building Kubernetes Clusters Client: %+v", err)
}
o.Configure(kubernetesClustersClient.Client, o.Authorizers.ResourceManager)

kubernetesExtensionsClient, err := extensions.NewExtensionsClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
Expand All @@ -75,30 +81,42 @@ func NewContainersClient(o *common.ClientOptions) (*Client, error) {
}
o.Configure(fluxConfigurationClient.Client, o.Authorizers.ResourceManager)

agentPoolsClient := agentpools.NewAgentPoolsClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&agentPoolsClient.Client, o.ResourceManagerAuthorizer)
agentPoolsClient, err := agentpools.NewAgentPoolsClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building Agent Pools Client: %+v", err)
}
o.Configure(agentPoolsClient.Client, o.Authorizers.ResourceManager)

maintenanceConfigurationsClient := maintenanceconfigurations.NewMaintenanceConfigurationsClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&maintenanceConfigurationsClient.Client, o.ResourceManagerAuthorizer)
maintenanceConfigurationsClient, err := maintenanceconfigurations.NewMaintenanceConfigurationsClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building Maintenance Configurations Client: %+v", err)
}
o.Configure(maintenanceConfigurationsClient.Client, o.Authorizers.ResourceManager)

servicesClient := containerservices.NewContainerServicesClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&servicesClient.Client, o.ResourceManagerAuthorizer)
servicesClient, err := containerservices.NewContainerServicesClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building Services Client: %+v", err)
}
o.Configure(servicesClient.Client, o.Authorizers.ResourceManager)

snapshotClient := snapshots.NewSnapshotsClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&snapshotClient.Client, o.ResourceManagerAuthorizer)
snapshotClient, err := snapshots.NewSnapshotsClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building Snapshot Client: %+v", err)
}
o.Configure(snapshotClient.Client, o.Authorizers.ResourceManager)

return &Client{
AgentPoolsClient: &agentPoolsClient,
AgentPoolsClient: agentPoolsClient,
ContainerInstanceClient: &containerInstanceClient,
ContainerRegistryClient_v2021_08_01_preview: containerRegistryClient_v2021_08_01_preview,
ContainerRegistryClient_v2019_06_01_preview: containerRegistryClient_v2019_06_01_preview,
FleetUpdateStrategiesClient: &fleetUpdateStrategiesClient,
KubernetesClustersClient: &kubernetesClustersClient,
FleetUpdateStrategiesClient: fleetUpdateStrategiesClient,
KubernetesClustersClient: kubernetesClustersClient,
KubernetesExtensionsClient: kubernetesExtensionsClient,
KubernetesFluxConfigurationClient: fluxConfigurationClient,
MaintenanceConfigurationsClient: &maintenanceConfigurationsClient,
ServicesClient: &servicesClient,
SnapshotClient: &snapshotClient,
MaintenanceConfigurationsClient: maintenanceConfigurationsClient,
ServicesClient: servicesClient,
SnapshotClient: snapshotClient,
Environment: o.AzureEnvironment,
}, nil
}
29 changes: 19 additions & 10 deletions internal/services/containers/client/client_gen.go
Original file line number Diff line number Diff line change
@@ -1,32 +1,41 @@
package client

import (
"github.com/Azure/go-autorest/autorest"
containerserviceV20220902Preview "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview"
containerserviceV20230302Preview "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-03-02-preview"
containerserviceV20231015 "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-10-15"
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
)

type AutoClient struct {
V20220902Preview containerserviceV20220902Preview.Client
V20230302Preview containerserviceV20230302Preview.Client
V20231015 containerserviceV20231015.Client
V20220902Preview *containerserviceV20220902Preview.Client
V20230302Preview *containerserviceV20230302Preview.Client
V20231015 *containerserviceV20231015.Client
}

func NewClient(o *common.ClientOptions) (*AutoClient, error) {

v20220902PreviewClient := containerserviceV20220902Preview.NewClientWithBaseURI(o.ResourceManagerEndpoint, func(c *autorest.Client) {
o.ConfigureClient(c, o.ResourceManagerAuthorizer)
v20220902PreviewClient, err := containerserviceV20220902Preview.NewClientWithBaseURI(o.Environment.ResourceManager, func(c *resourcemanager.Client) {
o.Configure(c, o.Authorizers.ResourceManager)
})
if err != nil {
return nil, err
}

v20230302PreviewClient := containerserviceV20230302Preview.NewClientWithBaseURI(o.ResourceManagerEndpoint, func(c *autorest.Client) {
o.ConfigureClient(c, o.ResourceManagerAuthorizer)
v20230302PreviewClient, err := containerserviceV20230302Preview.NewClientWithBaseURI(o.Environment.ResourceManager, func(c *resourcemanager.Client) {
o.Configure(c, o.Authorizers.ResourceManager)
})
if err != nil {
return nil, err
}

v20231015Client := containerserviceV20231015.NewClientWithBaseURI(o.ResourceManagerEndpoint, func(c *autorest.Client) {
o.ConfigureClient(c, o.ResourceManagerAuthorizer)
v20231015Client, err := containerserviceV20231015.NewClientWithBaseURI(o.Environment.ResourceManager, func(c *resourcemanager.Client) {
o.Configure(c, o.Authorizers.ResourceManager)
})
if err != nil {
return nil, err
}

return &AutoClient{
V20220902Preview: v20220902PreviewClient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -667,15 +667,11 @@ func resourceKubernetesClusterNodePoolCreate(d *pluginsdk.ResourceData, meta int
Properties: &profile,
}

future, err := poolsClient.CreateOrUpdate(ctx, id, parameters)
err = poolsClient.CreateOrUpdateThenPoll(ctx, id, parameters)
if err != nil {
return fmt.Errorf("creating %s: %+v", id, err)
}

if err = future.Poller.PollUntilDone(); err != nil {
return fmt.Errorf("waiting for creation of %s: %+v", id, err)
}

d.SetId(id.ID())
return resourceKubernetesClusterNodePoolRead(d, meta)
}
Expand Down Expand Up @@ -833,15 +829,11 @@ func resourceKubernetesClusterNodePoolUpdate(d *pluginsdk.ResourceData, meta int

log.Printf("[DEBUG] Updating existing %s..", *id)
existing.Model.Properties = props
future, err := client.CreateOrUpdate(ctx, *id, *existing.Model)
err = client.CreateOrUpdateThenPoll(ctx, *id, *existing.Model)
if err != nil {
return fmt.Errorf("updating Node Pool %s: %+v", *id, err)
}

if err = future.Poller.PollUntilDone(); err != nil {
return fmt.Errorf("waiting for update of %s: %+v", *id, err)
}

d.Partial(false)

return resourceKubernetesClusterNodePoolRead(d, meta)
Expand Down Expand Up @@ -1065,17 +1057,13 @@ func resourceKubernetesClusterNodePoolDelete(d *pluginsdk.ResourceData, meta int
}

ignorePodDisruptionBudget := true
future, err := client.Delete(ctx, *id, agentpools.DeleteOperationOptions{
err = client.DeleteThenPoll(ctx, *id, agentpools.DeleteOperationOptions{
IgnorePodDisruptionBudget: &ignorePodDisruptionBudget,
})
if err != nil {
return fmt.Errorf("deleting %s: %+v", *id, err)
}

if err := future.Poller.PollUntilDone(); err != nil {
return fmt.Errorf("waiting for the deletion of %s: %+v", id, err)
}

return nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1152,15 +1152,11 @@ func (KubernetesClusterNodePoolResource) scaleNodePool(nodeCount int) acceptance

nodePool.Model.Properties.Count = utils.Int64(int64(nodeCount))

future, err := clients.Containers.AgentPoolsClient.CreateOrUpdate(ctx, parsedAgentPoolId, *nodePool.Model)
err = clients.Containers.AgentPoolsClient.CreateOrUpdateThenPoll(ctx, parsedAgentPoolId, *nodePool.Model)
if err != nil {
return fmt.Errorf("Bad: updating node pool %q: %+v", nodePoolName, err)
}

if err := future.Poller.PollUntilDone(); err != nil {
return fmt.Errorf("Bad: waiting for update of node pool %q: %+v", nodePoolName, err)
}

return nil
}
}
Expand Down
34 changes: 6 additions & 28 deletions internal/services/containers/kubernetes_cluster_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -1838,15 +1838,11 @@ func resourceKubernetesClusterCreate(d *pluginsdk.ResourceData, meta interface{}
parameters.Properties.ServiceMeshProfile = serviceMeshProfile
}

future, err := client.CreateOrUpdate(ctx, id, parameters)
err = client.CreateOrUpdateThenPoll(ctx, id, parameters)
if err != nil {
return fmt.Errorf("creating %s: %+v", id, err)
}

if err = future.Poller.PollUntilDone(); err != nil {
return fmt.Errorf("waiting for creation of %s: %+v", id, err)
}

if maintenanceConfigRaw, ok := d.GetOk("maintenance_window"); ok {
client := meta.(*clients.Client).Containers.MaintenanceConfigurationsClient
parameters := maintenanceconfigurations.MaintenanceConfiguration{
Expand Down Expand Up @@ -1935,13 +1931,10 @@ func resourceKubernetesClusterUpdate(d *pluginsdk.ResourceData, meta interface{}
Secret: utils.String(clientSecret),
}

future, err := clusterClient.ResetServicePrincipalProfile(ctx, *id, params)
err = clusterClient.ResetServicePrincipalProfileThenPoll(ctx, *id, params)
if err != nil {
return fmt.Errorf("updating Service Principal for %s: %+v", *id, err)
}
if err = future.Poller.PollUntilDone(); err != nil {
return fmt.Errorf("waiting for update of Service Principal for %s: %+v", *id, err)
}
log.Printf("[DEBUG] Updated the Service Principal for %s.", *id)

// since we're patching it, re-retrieve the latest version of the cluster
Expand Down Expand Up @@ -1984,14 +1977,10 @@ func resourceKubernetesClusterUpdate(d *pluginsdk.ResourceData, meta interface{}
props.AadProfile = azureADProfile
if props.AadProfile != nil && (props.AadProfile.Managed == nil || !*props.AadProfile.Managed) {
log.Printf("[DEBUG] Updating the RBAC AAD profile")
future, err := clusterClient.ResetAADProfile(ctx, *id, *props.AadProfile)
err = clusterClient.ResetAADProfileThenPoll(ctx, *id, *props.AadProfile)
if err != nil {
return fmt.Errorf("updating Managed Kubernetes Cluster AAD Profile for %s: %+v", *id, err)
}

if err = future.Poller.PollUntilDone(); err != nil {
return fmt.Errorf("waiting for update of RBAC AAD profile of %s: %+v", *id, err)
}
}

if props.AadProfile != nil && props.AadProfile.Managed != nil && *props.AadProfile.Managed {
Expand Down Expand Up @@ -2345,14 +2334,11 @@ func resourceKubernetesClusterUpdate(d *pluginsdk.ResourceData, meta interface{}
}

log.Printf("[DEBUG] Updating %s..", *id)
future, err := clusterClient.CreateOrUpdate(ctx, *id, *existing.Model)
err = clusterClient.CreateOrUpdateThenPoll(ctx, *id, *existing.Model)
if err != nil {
return fmt.Errorf("updating %s: %+v", *id, err)
}

if err = future.Poller.PollUntilDone(); err != nil {
return fmt.Errorf("waiting for update of %s: %+v", *id, err)
}
log.Printf("[DEBUG] Updated %s..", *id)
}

Expand All @@ -2370,15 +2356,11 @@ func resourceKubernetesClusterUpdate(d *pluginsdk.ResourceData, meta interface{}
log.Printf("[DEBUG] Upgrading the version of Kubernetes to %q..", kubernetesVersion)
existing.Model.Properties.KubernetesVersion = utils.String(kubernetesVersion)

future, err := clusterClient.CreateOrUpdate(ctx, *id, *existing.Model)
err = clusterClient.CreateOrUpdateThenPoll(ctx, *id, *existing.Model)
if err != nil {
return fmt.Errorf("updating Kubernetes Version for %s: %+v", *id, err)
}

if err = future.Poller.PollUntilDone(); err != nil {
return fmt.Errorf("waiting for update of %s: %+v", *id, err)
}

log.Printf("[DEBUG] Upgraded the version of Kubernetes to %q..", kubernetesVersion)
}

Expand Down Expand Up @@ -2905,17 +2887,13 @@ func resourceKubernetesClusterDelete(d *pluginsdk.ResourceData, meta interface{}
}

ignorePodDisruptionBudget := true
future, err := client.Delete(ctx, *id, managedclusters.DeleteOperationOptions{
err = client.DeleteThenPoll(ctx, *id, managedclusters.DeleteOperationOptions{
IgnorePodDisruptionBudget: &ignorePodDisruptionBudget,
})
if err != nil {
return fmt.Errorf("deleting %s: %+v", *id, err)
}

if err := future.Poller.PollUntilDone(); err != nil {
return fmt.Errorf("waiting for the deletion of %s: %+v", *id, err)
}

return nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,11 @@ func (KubernetesClusterResource) updateDefaultNodePoolAgentCount(nodeCount int)

nodePool.Model.Properties.Count = utils.Int64(int64(nodeCount))

future, err := clients.Containers.AgentPoolsClient.CreateOrUpdate(ctx, agentPoolId, *nodePool.Model)
err = clients.Containers.AgentPoolsClient.CreateOrUpdateThenPoll(ctx, agentPoolId, *nodePool.Model)
if err != nil {
return fmt.Errorf("Bad: updating node pool %q: %+v", nodePoolName, err)
}

if err := future.Poller.PollUntilDone(); err != nil {
return fmt.Errorf("Bad: waiting for update of node pool %q: %+v", nodePoolName, err)
}

return nil
}
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e6c0652

Please sign in to comment.