Skip to content

Commit

Permalink
containers: update use of autorest azure.Environment to go-azure-sd…
Browse files Browse the repository at this point in the history
…k `environments.Environment`
  • Loading branch information
manicminer committed Apr 10, 2024
1 parent f23ded9 commit d948150
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions internal/services/containers/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package client
import (
"fmt"

"github.com/Azure/go-autorest/autorest/azure"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerinstance/2023-05-01/containerinstance"
containerregistry_v2019_06_01_preview "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2019-06-01-preview"
containerregistry_v2021_08_01_preview "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01-preview"
Expand All @@ -20,6 +19,7 @@ import (
"github.com/hashicorp/go-azure-sdk/resource-manager/kubernetesconfiguration/2022-11-01/extensions"
"github.com/hashicorp/go-azure-sdk/resource-manager/kubernetesconfiguration/2022-11-01/fluxconfiguration"
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager"
"github.com/hashicorp/go-azure-sdk/sdk/environments"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
)

Expand All @@ -37,7 +37,7 @@ type Client struct {
MaintenanceConfigurationsClient *maintenanceconfigurations.MaintenanceConfigurationsClient
ServicesClient *containerservices.ContainerServicesClient
SnapshotClient *snapshots.SnapshotsClient
Environment azure.Environment
Environment environments.Environment
}

func NewContainersClient(o *common.ClientOptions) (*Client, error) {
Expand Down Expand Up @@ -129,6 +129,6 @@ func NewContainersClient(o *common.ClientOptions) (*Client, error) {
MaintenanceConfigurationsClient: maintenanceConfigurationsClient,
ServicesClient: servicesClient,
SnapshotClient: snapshotClient,
Environment: o.AzureEnvironment,
Environment: o.Environment,
}, nil
}
10 changes: 5 additions & 5 deletions internal/services/containers/kubernetes_addons.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"fmt"
"strings"

"github.com/Azure/go-autorest/autorest/azure"
"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonids"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-06-02-preview/managedclusters"
"github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2020-08-01/workspaces"
"github.com/hashicorp/go-azure-sdk/sdk/environments"
commonValidate "github.com/hashicorp/terraform-provider-azurerm/helpers/validate"
containerValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate"
applicationGatewayValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate"
Expand All @@ -37,11 +37,11 @@ const (
// the list of unsupported addons in the defined region - e.g. by being
// omitted from this list an addon/environment combination will be supported
var unsupportedAddonsForEnvironment = map[string][]string{
azure.ChinaCloud.Name: {
environments.AzureChinaCloud: {
aciConnectorKey, // https://github.com/hashicorp/terraform-provider-azurerm/issues/5510
httpApplicationRoutingKey, // https://github.com/hashicorp/terraform-provider-azurerm/issues/5960
},
azure.USGovernmentCloud.Name: {
environments.AzureUSGovernmentCloud: {
httpApplicationRoutingKey, // https://github.com/hashicorp/terraform-provider-azurerm/issues/5960
},
}
Expand Down Expand Up @@ -282,7 +282,7 @@ func schemaKubernetesAddOns() map[string]*pluginsdk.Schema {
return out
}

func expandKubernetesAddOns(d *pluginsdk.ResourceData, input map[string]interface{}, env azure.Environment) (*map[string]managedclusters.ManagedClusterAddonProfile, error) {
func expandKubernetesAddOns(d *pluginsdk.ResourceData, input map[string]interface{}, env environments.Environment) (*map[string]managedclusters.ManagedClusterAddonProfile, error) {
disabled := managedclusters.ManagedClusterAddonProfile{
Enabled: false,
}
Expand Down Expand Up @@ -421,7 +421,7 @@ func expandKubernetesAddOns(d *pluginsdk.ResourceData, input map[string]interfac
return filterUnsupportedKubernetesAddOns(addonProfiles, env)
}

func filterUnsupportedKubernetesAddOns(input map[string]managedclusters.ManagedClusterAddonProfile, env azure.Environment) (*map[string]managedclusters.ManagedClusterAddonProfile, error) {
func filterUnsupportedKubernetesAddOns(input map[string]managedclusters.ManagedClusterAddonProfile, env environments.Environment) (*map[string]managedclusters.ManagedClusterAddonProfile, error) {
filter := func(input map[string]managedclusters.ManagedClusterAddonProfile, key string) (map[string]managedclusters.ManagedClusterAddonProfile, error) {
output := input
if v, ok := output[key]; ok {
Expand Down

0 comments on commit d948150

Please sign in to comment.