From 01b0e37ba9d975f73b987fc59b8e6f8027509122 Mon Sep 17 00:00:00 2001 From: Dmitry Zbarski Date: Mon, 27 Jan 2020 13:35:16 +0200 Subject: [PATCH 1/5] Add support for node_labels in azurerm_kubernetes_cluster and azurerm_kubernetes_cluster_node_pool resources #4968 --- .../services/containers/client/client.go | 2 +- .../data_source_kubernetes_cluster.go | 14 +- .../services/containers/kubernetes_addons.go | 2 +- .../containers/kubernetes_nodepool.go | 24 ++- .../resource_arm_kubernetes_cluster.go | 2 +- ...source_arm_kubernetes_cluster_node_pool.go | 20 +- azurerm/utils/common_marshal.go | 20 ++ .../containerservice/agentpools.go | 21 +- .../containerservice/client.go | 0 .../containerservice/containerservices.go | 0 .../containerservice/managedclusters.go | 122 ++--------- .../containerservice/models.go | 197 +++++++++++++++++- .../openshiftmanagedclusters.go | 0 .../containerservice/operations.go | 2 +- .../containerservice/version.go | 2 +- vendor/modules.txt | 2 +- .../docs/r/kubernetes_cluster.html.markdown | 2 + ...kubernetes_cluster_node_pool.html.markdown | 2 + 18 files changed, 313 insertions(+), 121 deletions(-) rename vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/{2019-10-01 => 2019-11-01}/containerservice/agentpools.go (96%) rename vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/{2019-10-01 => 2019-11-01}/containerservice/client.go (100%) rename vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/{2019-10-01 => 2019-11-01}/containerservice/containerservices.go (100%) rename vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/{2019-10-01 => 2019-11-01}/containerservice/managedclusters.go (92%) rename vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/{2019-10-01 => 2019-11-01}/containerservice/models.go (95%) rename vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/{2019-10-01 => 2019-11-01}/containerservice/openshiftmanagedclusters.go (100%) rename vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/{2019-10-01 => 2019-11-01}/containerservice/operations.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/{2019-10-01 => 2019-11-01}/containerservice/version.go (98%) diff --git a/azurerm/internal/services/containers/client/client.go b/azurerm/internal/services/containers/client/client.go index a76184c890fa..b560bc983b4a 100644 --- a/azurerm/internal/services/containers/client/client.go +++ b/azurerm/internal/services/containers/client/client.go @@ -3,7 +3,7 @@ package client import ( "github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance" "github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2018-09-01/containerregistry" - "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice" + "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/common" ) diff --git a/azurerm/internal/services/containers/data_source_kubernetes_cluster.go b/azurerm/internal/services/containers/data_source_kubernetes_cluster.go index 32586415953d..d094d12f80c1 100644 --- a/azurerm/internal/services/containers/data_source_kubernetes_cluster.go +++ b/azurerm/internal/services/containers/data_source_kubernetes_cluster.go @@ -5,7 +5,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice" + "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/kubernetes" @@ -169,6 +169,14 @@ func dataSourceArmKubernetesCluster() *schema.Resource { Computed: true, }, + "node_labels": { + Type: schema.TypeMap, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "node_taints": { Type: schema.TypeList, Optional: true, @@ -743,6 +751,10 @@ func flattenKubernetesClusterDataSourceAgentPoolProfiles(input *[]containerservi agentPoolProfile["max_pods"] = int(*profile.MaxPods) } + if profile.NodeLabels != nil { + agentPoolProfile["node_labels"] = profile.NodeLabels + } + if profile.NodeTaints != nil { agentPoolProfile["node_taints"] = *profile.NodeTaints } diff --git a/azurerm/internal/services/containers/kubernetes_addons.go b/azurerm/internal/services/containers/kubernetes_addons.go index 36f1fc665bb8..1f4579c58bb6 100644 --- a/azurerm/internal/services/containers/kubernetes_addons.go +++ b/azurerm/internal/services/containers/kubernetes_addons.go @@ -3,7 +3,7 @@ package containers import ( "strings" - "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice" + "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" diff --git a/azurerm/internal/services/containers/kubernetes_nodepool.go b/azurerm/internal/services/containers/kubernetes_nodepool.go index d7a63d3699a4..58a9517a266e 100644 --- a/azurerm/internal/services/containers/kubernetes_nodepool.go +++ b/azurerm/internal/services/containers/kubernetes_nodepool.go @@ -3,7 +3,7 @@ package containers import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice" + "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -90,6 +90,15 @@ func SchemaDefaultNodePool() *schema.Schema { ValidateFunc: validation.IntBetween(1, 100), }, + "node_labels": { + Type: schema.TypeMap, + ForceNew: true, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "node_taints": { Type: schema.TypeList, Optional: true, @@ -135,6 +144,7 @@ func ConvertDefaultNodePoolToAgentPool(input *[]containerservice.ManagedClusterA EnableNodePublicIP: defaultCluster.EnableNodePublicIP, ScaleSetPriority: defaultCluster.ScaleSetPriority, ScaleSetEvictionPolicy: defaultCluster.ScaleSetEvictionPolicy, + NodeLabels: defaultCluster.NodeLabels, NodeTaints: defaultCluster.NodeTaints, }, } @@ -145,6 +155,8 @@ func ExpandDefaultNodePool(d *schema.ResourceData) (*[]containerservice.ManagedC raw := input[0].(map[string]interface{}) enableAutoScaling := raw["enable_auto_scaling"].(bool) + nodeLabelsRaw := raw["node_labels"].(map[string]interface{}) + nodeLabels := utils.ExpandMapStringPtrString(nodeLabelsRaw) nodeTaintsRaw := raw["node_taints"].([]interface{}) nodeTaints := utils.ExpandStringSlice(nodeTaintsRaw) @@ -152,6 +164,7 @@ func ExpandDefaultNodePool(d *schema.ResourceData) (*[]containerservice.ManagedC EnableAutoScaling: utils.Bool(enableAutoScaling), EnableNodePublicIP: utils.Bool(raw["enable_node_public_ip"].(bool)), Name: utils.String(raw["name"].(string)), + NodeLabels: nodeLabels, NodeTaints: nodeTaints, Type: containerservice.AgentPoolType(raw["type"].(string)), VMSize: containerservice.VMSizeTypes(raw["vm_size"].(string)), @@ -281,6 +294,14 @@ func FlattenDefaultNodePool(input *[]containerservice.ManagedClusterAgentPoolPro name = *agentPool.Name } + var nodeLabels map[string]string + if agentPool.NodeLabels != nil { + nodeLabels = make(map[string]string) + for k, v := range agentPool.NodeLabels { + nodeLabels[k] = *v + } + } + var nodeTaints []string if agentPool.NodeTaints != nil { nodeTaints = *agentPool.NodeTaints @@ -306,6 +327,7 @@ func FlattenDefaultNodePool(input *[]containerservice.ManagedClusterAgentPoolPro "min_count": minCount, "name": name, "node_count": count, + "node_labels": nodeLabels, "node_taints": nodeTaints, "os_disk_size_gb": osDiskSizeGB, "type": string(agentPool.Type), diff --git a/azurerm/internal/services/containers/resource_arm_kubernetes_cluster.go b/azurerm/internal/services/containers/resource_arm_kubernetes_cluster.go index 6d75e381af68..8e7e2efed85b 100644 --- a/azurerm/internal/services/containers/resource_arm_kubernetes_cluster.go +++ b/azurerm/internal/services/containers/resource_arm_kubernetes_cluster.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice" + "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" diff --git a/azurerm/internal/services/containers/resource_arm_kubernetes_cluster_node_pool.go b/azurerm/internal/services/containers/resource_arm_kubernetes_cluster_node_pool.go index 805c9abb3c41..b62f8ff61224 100644 --- a/azurerm/internal/services/containers/resource_arm_kubernetes_cluster_node_pool.go +++ b/azurerm/internal/services/containers/resource_arm_kubernetes_cluster_node_pool.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice" + "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -99,6 +99,15 @@ func resourceArmKubernetesClusterNodePool() *schema.Resource { ValidateFunc: validation.IntBetween(1, 100), }, + "node_labels": { + Type: schema.TypeMap, + Optional: true, + ForceNew: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "node_taints": { Type: schema.TypeList, Optional: true, @@ -213,6 +222,11 @@ func resourceArmKubernetesClusterNodePoolCreate(d *schema.ResourceData, meta int profile.MaxPods = utils.Int32(maxPods) } + nodeLabelsRaw := d.Get("node_labels").(map[string]interface{}) + if nodeLabels := utils.ExpandMapStringPtrString(nodeLabelsRaw); len(nodeLabels) > 0 { + profile.NodeLabels = nodeLabels + } + nodeTaintsRaw := d.Get("node_taints").([]interface{}) if nodeTaints := utils.ExpandStringSlice(nodeTaintsRaw); len(*nodeTaints) > 0 { profile.NodeTaints = nodeTaints @@ -466,6 +480,10 @@ func resourceArmKubernetesClusterNodePoolRead(d *schema.ResourceData, meta inter } d.Set("node_count", count) + if err := d.Set("node_labels", props.NodeLabels); err != nil { + return fmt.Errorf("Error setting `node_labels`: %+v", err) + } + if err := d.Set("node_taints", utils.FlattenStringSlice(props.NodeTaints)); err != nil { return fmt.Errorf("Error setting `node_taints`: %+v", err) } diff --git a/azurerm/utils/common_marshal.go b/azurerm/utils/common_marshal.go index 33bdc24c4fbf..f2ee8a633d61 100644 --- a/azurerm/utils/common_marshal.go +++ b/azurerm/utils/common_marshal.go @@ -12,6 +12,14 @@ func ExpandStringSlice(input []interface{}) *[]string { return &result } +func ExpandMapStringPtrString(input map[string]interface{}) map[string]*string { + result := make(map[string]*string) + for k, v := range input { + result[k] = String(v.(string)) + } + return result +} + func FlattenStringSlice(input *[]string) []interface{} { result := make([]interface{}, 0) if input != nil { @@ -21,3 +29,15 @@ func FlattenStringSlice(input *[]string) []interface{} { } return result } + +func FlattenMapStringPtrString(input map[string]*string) map[string]interface{} { + result := make(map[string]interface{}) + for k, v := range input { + if v == nil { + result[k] = "" + } else { + result[k] = *v + } + } + return result +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice/agentpools.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice/agentpools.go similarity index 96% rename from vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice/agentpools.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice/agentpools.go index 1412b4cb84c9..3926308d98f6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice/agentpools.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice/agentpools.go @@ -64,7 +64,14 @@ func (client AgentPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroup {TargetValue: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties.Count", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties.Count", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, + {Target: "parameters.ManagedClusterAgentPoolProfileProperties.Count", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}, + }}}}}); err != nil { return result, validation.NewError("containerservice.AgentPoolsClient", "CreateOrUpdate", err.Error()) } @@ -92,7 +99,7 @@ func (client AgentPoolsClient) CreateOrUpdatePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-10-01" + const APIVersion = "2019-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -183,7 +190,7 @@ func (client AgentPoolsClient) DeletePreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-10-01" + const APIVersion = "2019-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -277,7 +284,7 @@ func (client AgentPoolsClient) GetPreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-10-01" + const APIVersion = "2019-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -364,7 +371,7 @@ func (client AgentPoolsClient) GetAvailableAgentPoolVersionsPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-10-01" + const APIVersion = "2019-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -454,7 +461,7 @@ func (client AgentPoolsClient) GetUpgradeProfilePreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-10-01" + const APIVersion = "2019-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -543,7 +550,7 @@ func (client AgentPoolsClient) ListPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-10-01" + const APIVersion = "2019-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice/client.go similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice/client.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice/client.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice/containerservices.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice/containerservices.go similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice/containerservices.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice/containerservices.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice/managedclusters.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice/managedclusters.go similarity index 92% rename from vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice/managedclusters.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice/managedclusters.go index 2fd0fa910f54..3fefb76debbd 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice/managedclusters.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice/managedclusters.go @@ -95,6 +95,14 @@ func (client ManagedClustersClient) CreateOrUpdate(ctx context.Context, resource {Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.ManagedOutboundIPs.Count", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, }}, }}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.AllocatedOutboundPorts", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.AllocatedOutboundPorts", Name: validation.InclusiveMaximum, Rule: int64(64000), Chain: nil}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.AllocatedOutboundPorts", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + }}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.IdleTimeoutInMinutes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.IdleTimeoutInMinutes", Name: validation.InclusiveMaximum, Rule: int64(120), Chain: nil}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.IdleTimeoutInMinutes", Name: validation.InclusiveMinimum, Rule: int64(4), Chain: nil}, + }}, }}, }}, {Target: "parameters.ManagedClusterProperties.AadProfile", Name: validation.Null, Rule: false, @@ -128,7 +136,7 @@ func (client ManagedClustersClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-10-01" + const APIVersion = "2019-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -217,7 +225,7 @@ func (client ManagedClustersClient) DeletePreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-10-01" + const APIVersion = "2019-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -309,7 +317,7 @@ func (client ManagedClustersClient) GetPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-10-01" + const APIVersion = "2019-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -399,7 +407,7 @@ func (client ManagedClustersClient) GetAccessProfilePreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-10-01" + const APIVersion = "2019-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -487,7 +495,7 @@ func (client ManagedClustersClient) GetUpgradeProfilePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-10-01" + const APIVersion = "2019-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -561,7 +569,7 @@ func (client ManagedClustersClient) ListPreparer(ctx context.Context) (*http.Req "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-10-01" + const APIVersion = "2019-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -681,7 +689,7 @@ func (client ManagedClustersClient) ListByResourceGroupPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-10-01" + const APIVersion = "2019-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -806,7 +814,7 @@ func (client ManagedClustersClient) ListClusterAdminCredentialsPreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-10-01" + const APIVersion = "2019-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -839,94 +847,6 @@ func (client ManagedClustersClient) ListClusterAdminCredentialsResponder(resp *h return } -// ListClusterMonitoringUserCredentials gets cluster monitoring user credential of the managed cluster with a specified -// resource group and name. -// Parameters: -// resourceGroupName - the name of the resource group. -// resourceName - the name of the managed cluster resource. -func (client ManagedClustersClient) ListClusterMonitoringUserCredentials(ctx context.Context, resourceGroupName string, resourceName string) (result CredentialResults, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ListClusterMonitoringUserCredentials") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceName, - Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, - {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("containerservice.ManagedClustersClient", "ListClusterMonitoringUserCredentials", err.Error()) - } - - req, err := client.ListClusterMonitoringUserCredentialsPreparer(ctx, resourceGroupName, resourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterMonitoringUserCredentials", nil, "Failure preparing request") - return - } - - resp, err := client.ListClusterMonitoringUserCredentialsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterMonitoringUserCredentials", resp, "Failure sending request") - return - } - - result, err = client.ListClusterMonitoringUserCredentialsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterMonitoringUserCredentials", resp, "Failure responding to request") - } - - return -} - -// ListClusterMonitoringUserCredentialsPreparer prepares the ListClusterMonitoringUserCredentials request. -func (client ManagedClustersClient) ListClusterMonitoringUserCredentialsPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "resourceName": autorest.Encode("path", resourceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-10-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListClusterMonitoringUserCredentialsSender sends the ListClusterMonitoringUserCredentials request. The method will close the -// http.Response Body if it receives an error. -func (client ManagedClustersClient) ListClusterMonitoringUserCredentialsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListClusterMonitoringUserCredentialsResponder handles the response to the ListClusterMonitoringUserCredentials request. The method always -// closes the http.Response Body. -func (client ManagedClustersClient) ListClusterMonitoringUserCredentialsResponder(resp *http.Response) (result CredentialResults, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - // ListClusterUserCredentials gets cluster user credential of the managed cluster with a specified resource group and // name. // Parameters: @@ -982,7 +902,7 @@ func (client ManagedClustersClient) ListClusterUserCredentialsPreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-10-01" + const APIVersion = "2019-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1067,7 +987,7 @@ func (client ManagedClustersClient) ResetAADProfilePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-10-01" + const APIVersion = "2019-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1158,7 +1078,7 @@ func (client ManagedClustersClient) ResetServicePrincipalProfilePreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-10-01" + const APIVersion = "2019-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1246,7 +1166,7 @@ func (client ManagedClustersClient) RotateClusterCertificatesPreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-10-01" + const APIVersion = "2019-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1333,7 +1253,7 @@ func (client ManagedClustersClient) UpdateTagsPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-10-01" + const APIVersion = "2019-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice/models.go similarity index 95% rename from vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice/models.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice/models.go index 5396d66d0e72..c1623455b6d2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice/models.go @@ -28,7 +28,7 @@ import ( ) // The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice" +const fqdn = "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice" // AgentPoolType enumerates the values for agent pool type. type AgentPoolType string @@ -233,6 +233,21 @@ func PossibleOSTypeValues() []OSType { return []OSType{Linux, Windows} } +// OutboundType enumerates the values for outbound type. +type OutboundType string + +const ( + // LoadBalancer ... + LoadBalancer OutboundType = "loadBalancer" + // UserDefinedRouting ... + UserDefinedRouting OutboundType = "userDefinedRouting" +) + +// PossibleOutboundTypeValues returns an array of possible values for the OutboundType const type. +func PossibleOutboundTypeValues() []OutboundType { + return []OutboundType{LoadBalancer, UserDefinedRouting} +} + // ResourceIdentityType enumerates the values for resource identity type. type ResourceIdentityType string @@ -1729,6 +1744,8 @@ type ManagedClusterAddonProfile struct { Enabled *bool `json:"enabled,omitempty"` // Config - Key-value pairs for configuring an add-on. Config map[string]*string `json:"config"` + // Identity - READ-ONLY; Information of user assigned identity used by this add-on. + Identity *ManagedClusterAddonProfileIdentity `json:"identity,omitempty"` } // MarshalJSON is the custom marshaler for ManagedClusterAddonProfile. @@ -1743,6 +1760,16 @@ func (mcap ManagedClusterAddonProfile) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// ManagedClusterAddonProfileIdentity information of user assigned identity used by this add-on. +type ManagedClusterAddonProfileIdentity struct { + // ResourceID - The resource id of the user assigned identity. + ResourceID *string `json:"resourceId,omitempty"` + // ClientID - The client id of the user assigned identity. + ClientID *string `json:"clientId,omitempty"` + // ObjectID - The object id of the user assigned identity. + ObjectID *string `json:"objectId,omitempty"` +} + // ManagedClusterAgentPoolProfile profile for the container service agent pool. type ManagedClusterAgentPoolProfile struct { // Name - Unique name of the agent pool profile in the context of the subscription and resource group. @@ -1771,7 +1798,7 @@ type ManagedClusterAgentPoolProfile struct { OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response. ProvisioningState *string `json:"provisioningState,omitempty"` - // AvailabilityZones - (PREVIEW) Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. + // AvailabilityZones - Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. AvailabilityZones *[]string `json:"availabilityZones,omitempty"` // EnableNodePublicIP - Enable public IP for nodes EnableNodePublicIP *bool `json:"enableNodePublicIP,omitempty"` @@ -1779,10 +1806,77 @@ type ManagedClusterAgentPoolProfile struct { ScaleSetPriority ScaleSetPriority `json:"scaleSetPriority,omitempty"` // ScaleSetEvictionPolicy - ScaleSetEvictionPolicy to be used to specify eviction policy for low priority virtual machine scale set. Default to Delete. Possible values include: 'Delete', 'Deallocate' ScaleSetEvictionPolicy ScaleSetEvictionPolicy `json:"scaleSetEvictionPolicy,omitempty"` + // Tags - Agent pool tags to be persisted on the agent pool virtual machine scale set. + Tags map[string]*string `json:"tags"` + // NodeLabels - Agent pool node labels to be persisted across all nodes in agent pool. + NodeLabels map[string]*string `json:"nodeLabels"` // NodeTaints - Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. NodeTaints *[]string `json:"nodeTaints,omitempty"` } +// MarshalJSON is the custom marshaler for ManagedClusterAgentPoolProfile. +func (mcapp ManagedClusterAgentPoolProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcapp.Name != nil { + objectMap["name"] = mcapp.Name + } + if mcapp.Count != nil { + objectMap["count"] = mcapp.Count + } + if mcapp.VMSize != "" { + objectMap["vmSize"] = mcapp.VMSize + } + if mcapp.OsDiskSizeGB != nil { + objectMap["osDiskSizeGB"] = mcapp.OsDiskSizeGB + } + if mcapp.VnetSubnetID != nil { + objectMap["vnetSubnetID"] = mcapp.VnetSubnetID + } + if mcapp.MaxPods != nil { + objectMap["maxPods"] = mcapp.MaxPods + } + if mcapp.OsType != "" { + objectMap["osType"] = mcapp.OsType + } + if mcapp.MaxCount != nil { + objectMap["maxCount"] = mcapp.MaxCount + } + if mcapp.MinCount != nil { + objectMap["minCount"] = mcapp.MinCount + } + if mcapp.EnableAutoScaling != nil { + objectMap["enableAutoScaling"] = mcapp.EnableAutoScaling + } + if mcapp.Type != "" { + objectMap["type"] = mcapp.Type + } + if mcapp.OrchestratorVersion != nil { + objectMap["orchestratorVersion"] = mcapp.OrchestratorVersion + } + if mcapp.AvailabilityZones != nil { + objectMap["availabilityZones"] = mcapp.AvailabilityZones + } + if mcapp.EnableNodePublicIP != nil { + objectMap["enableNodePublicIP"] = mcapp.EnableNodePublicIP + } + if mcapp.ScaleSetPriority != "" { + objectMap["scaleSetPriority"] = mcapp.ScaleSetPriority + } + if mcapp.ScaleSetEvictionPolicy != "" { + objectMap["scaleSetEvictionPolicy"] = mcapp.ScaleSetEvictionPolicy + } + if mcapp.Tags != nil { + objectMap["tags"] = mcapp.Tags + } + if mcapp.NodeLabels != nil { + objectMap["nodeLabels"] = mcapp.NodeLabels + } + if mcapp.NodeTaints != nil { + objectMap["nodeTaints"] = mcapp.NodeTaints + } + return json.Marshal(objectMap) +} + // ManagedClusterAgentPoolProfileProperties properties for the container service agent pool profile. type ManagedClusterAgentPoolProfileProperties struct { // Count - Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. @@ -1809,7 +1903,7 @@ type ManagedClusterAgentPoolProfileProperties struct { OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response. ProvisioningState *string `json:"provisioningState,omitempty"` - // AvailabilityZones - (PREVIEW) Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. + // AvailabilityZones - Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. AvailabilityZones *[]string `json:"availabilityZones,omitempty"` // EnableNodePublicIP - Enable public IP for nodes EnableNodePublicIP *bool `json:"enableNodePublicIP,omitempty"` @@ -1817,10 +1911,74 @@ type ManagedClusterAgentPoolProfileProperties struct { ScaleSetPriority ScaleSetPriority `json:"scaleSetPriority,omitempty"` // ScaleSetEvictionPolicy - ScaleSetEvictionPolicy to be used to specify eviction policy for low priority virtual machine scale set. Default to Delete. Possible values include: 'Delete', 'Deallocate' ScaleSetEvictionPolicy ScaleSetEvictionPolicy `json:"scaleSetEvictionPolicy,omitempty"` + // Tags - Agent pool tags to be persisted on the agent pool virtual machine scale set. + Tags map[string]*string `json:"tags"` + // NodeLabels - Agent pool node labels to be persisted across all nodes in agent pool. + NodeLabels map[string]*string `json:"nodeLabels"` // NodeTaints - Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. NodeTaints *[]string `json:"nodeTaints,omitempty"` } +// MarshalJSON is the custom marshaler for ManagedClusterAgentPoolProfileProperties. +func (mcappp ManagedClusterAgentPoolProfileProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcappp.Count != nil { + objectMap["count"] = mcappp.Count + } + if mcappp.VMSize != "" { + objectMap["vmSize"] = mcappp.VMSize + } + if mcappp.OsDiskSizeGB != nil { + objectMap["osDiskSizeGB"] = mcappp.OsDiskSizeGB + } + if mcappp.VnetSubnetID != nil { + objectMap["vnetSubnetID"] = mcappp.VnetSubnetID + } + if mcappp.MaxPods != nil { + objectMap["maxPods"] = mcappp.MaxPods + } + if mcappp.OsType != "" { + objectMap["osType"] = mcappp.OsType + } + if mcappp.MaxCount != nil { + objectMap["maxCount"] = mcappp.MaxCount + } + if mcappp.MinCount != nil { + objectMap["minCount"] = mcappp.MinCount + } + if mcappp.EnableAutoScaling != nil { + objectMap["enableAutoScaling"] = mcappp.EnableAutoScaling + } + if mcappp.Type != "" { + objectMap["type"] = mcappp.Type + } + if mcappp.OrchestratorVersion != nil { + objectMap["orchestratorVersion"] = mcappp.OrchestratorVersion + } + if mcappp.AvailabilityZones != nil { + objectMap["availabilityZones"] = mcappp.AvailabilityZones + } + if mcappp.EnableNodePublicIP != nil { + objectMap["enableNodePublicIP"] = mcappp.EnableNodePublicIP + } + if mcappp.ScaleSetPriority != "" { + objectMap["scaleSetPriority"] = mcappp.ScaleSetPriority + } + if mcappp.ScaleSetEvictionPolicy != "" { + objectMap["scaleSetEvictionPolicy"] = mcappp.ScaleSetEvictionPolicy + } + if mcappp.Tags != nil { + objectMap["tags"] = mcappp.Tags + } + if mcappp.NodeLabels != nil { + objectMap["nodeLabels"] = mcappp.NodeLabels + } + if mcappp.NodeTaints != nil { + objectMap["nodeTaints"] = mcappp.NodeTaints + } + return json.Marshal(objectMap) +} + // ManagedClusterAPIServerAccessProfile access profile for managed cluster API server. type ManagedClusterAPIServerAccessProfile struct { // AuthorizedIPRanges - Authorized IP Ranges to kubernetes API server. @@ -1985,7 +2143,7 @@ func NewManagedClusterListResultPage(getNextPage func(context.Context, ManagedCl return ManagedClusterListResultPage{fn: getNextPage} } -// ManagedClusterLoadBalancerProfile profile of the managed cluster load balancer +// ManagedClusterLoadBalancerProfile profile of the managed cluster load balancer. type ManagedClusterLoadBalancerProfile struct { // ManagedOutboundIPs - Desired managed outbound IPs for the cluster load balancer. ManagedOutboundIPs *ManagedClusterLoadBalancerProfileManagedOutboundIPs `json:"managedOutboundIPs,omitempty"` @@ -1995,6 +2153,10 @@ type ManagedClusterLoadBalancerProfile struct { OutboundIPs *ManagedClusterLoadBalancerProfileOutboundIPs `json:"outboundIPs,omitempty"` // EffectiveOutboundIPs - The effective outbound IP resources of the cluster load balancer. EffectiveOutboundIPs *[]ResourceReference `json:"effectiveOutboundIPs,omitempty"` + // AllocatedOutboundPorts - Desired number of allocated SNAT ports per VM. Allowed values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. + AllocatedOutboundPorts *int32 `json:"allocatedOutboundPorts,omitempty"` + // IdleTimeoutInMinutes - Desired outbound flow idle timeout in minutes. Allowed values must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. + IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` } // ManagedClusterLoadBalancerProfileManagedOutboundIPs desired managed outbound IPs for the cluster load @@ -2074,6 +2236,8 @@ type ManagedClusterProperties struct { AadProfile *ManagedClusterAADProfile `json:"aadProfile,omitempty"` // APIServerAccessProfile - Access profile for managed cluster API server. APIServerAccessProfile *ManagedClusterAPIServerAccessProfile `json:"apiServerAccessProfile,omitempty"` + // IdentityProfile - Identities associated with the cluster. + IdentityProfile map[string]*ManagedClusterPropertiesIdentityProfileValue `json:"identityProfile"` } // MarshalJSON is the custom marshaler for ManagedClusterProperties. @@ -2118,9 +2282,22 @@ func (mcp ManagedClusterProperties) MarshalJSON() ([]byte, error) { if mcp.APIServerAccessProfile != nil { objectMap["apiServerAccessProfile"] = mcp.APIServerAccessProfile } + if mcp.IdentityProfile != nil { + objectMap["identityProfile"] = mcp.IdentityProfile + } return json.Marshal(objectMap) } +// ManagedClusterPropertiesIdentityProfileValue ... +type ManagedClusterPropertiesIdentityProfileValue struct { + // ResourceID - The resource id of the user assigned identity. + ResourceID *string `json:"resourceId,omitempty"` + // ClientID - The client id of the user assigned identity. + ClientID *string `json:"clientId,omitempty"` + // ObjectID - The object id of the user assigned identity. + ObjectID *string `json:"objectId,omitempty"` +} + // ManagedClustersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ManagedClustersCreateOrUpdateFuture struct { @@ -2413,6 +2590,8 @@ type NetworkProfileType struct { DNSServiceIP *string `json:"dnsServiceIP,omitempty"` // DockerBridgeCidr - A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. DockerBridgeCidr *string `json:"dockerBridgeCidr,omitempty"` + // OutboundType - The outbound (egress) routing method. Possible values include: 'LoadBalancer', 'UserDefinedRouting' + OutboundType OutboundType `json:"outboundType,omitempty"` // LoadBalancerSku - The load balancer sku for the managed cluster. Possible values include: 'Standard', 'Basic' LoadBalancerSku LoadBalancerSku `json:"loadBalancerSku,omitempty"` // LoadBalancerProfile - Profile of the cluster load balancer. @@ -3305,6 +3484,16 @@ func (toVar TagsObject) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// UserAssignedIdentity ... +type UserAssignedIdentity struct { + // ResourceID - The resource id of the user assigned identity. + ResourceID *string `json:"resourceId,omitempty"` + // ClientID - The client id of the user assigned identity. + ClientID *string `json:"clientId,omitempty"` + // ObjectID - The object id of the user assigned identity. + ObjectID *string `json:"objectId,omitempty"` +} + // VMDiagnostics profile for diagnostics on the container service VMs. type VMDiagnostics struct { // Enabled - Whether the VM diagnostic agent is provisioned on the VM. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice/openshiftmanagedclusters.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice/openshiftmanagedclusters.go similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice/openshiftmanagedclusters.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice/openshiftmanagedclusters.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice/operations.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice/operations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice/operations.go index 978c301f731c..766c2bb05521 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice/operations.go @@ -75,7 +75,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe // ListPreparer prepares the List request. func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2019-10-01" + const APIVersion = "2019-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice/version.go similarity index 98% rename from vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice/version.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice/version.go index 8c5a50141b93..89b5e786c909 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice/version.go @@ -21,7 +21,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + version.Number + " containerservice/2019-10-01" + return "Azure-SDK-For-Go/" + version.Number + " containerservice/2019-11-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/vendor/modules.txt b/vendor/modules.txt index ef8827c62e16..7eca8748beb2 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -19,7 +19,7 @@ github.com/Azure/azure-sdk-for-go/services/cognitiveservices/mgmt/2017-04-18/cog github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2018-09-01/containerregistry -github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-10-01/containerservice +github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb github.com/Azure/azure-sdk-for-go/services/databricks/mgmt/2018-04-01/databricks github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory diff --git a/website/docs/r/kubernetes_cluster.html.markdown b/website/docs/r/kubernetes_cluster.html.markdown index c8b599827b0f..6c4c1aaaacd8 100644 --- a/website/docs/r/kubernetes_cluster.html.markdown +++ b/website/docs/r/kubernetes_cluster.html.markdown @@ -193,6 +193,8 @@ A `default_node_pool` block supports the following: * `max_pods` - (Optional) The maximum number of pods that can run on each agent. Changing this forces a new resource to be created. +* `node_labels` - (Optional) A map of Kubernetes labels which should be applied to nodes in the Default Node Pool. + * `node_taints` - (Optional) A list of Kubernetes taints which should be applied to nodes in the agent pool (e.g `key=value:NoSchedule`). * `os_disk_size_gb` - (Optional) The size of the OS Disk which should be used for each agent in the Node Pool. Changing this forces a new resource to be created. diff --git a/website/docs/r/kubernetes_cluster_node_pool.html.markdown b/website/docs/r/kubernetes_cluster_node_pool.html.markdown index f4395f017987..fdc7da1b5624 100644 --- a/website/docs/r/kubernetes_cluster_node_pool.html.markdown +++ b/website/docs/r/kubernetes_cluster_node_pool.html.markdown @@ -70,6 +70,8 @@ The following arguments are supported: * `max_pods` - (Optional) The maximum number of pods that can run on each agent. Changing this forces a new resource to be created. +* `node_labels` - (Optional) A map of Kubernetes labels which should be applied to nodes in this Node Pool. + * `node_taints` - (Optional) A list of Kubernetes taints which should be applied to nodes in the agent pool (e.g `key=value:NoSchedule`). * `os_disk_size_gb` - (Optional) The Agent Operating System disk size in GB. Changing this forces a new resource to be created. From 7981e54c8b5138f6db09c952af59fd62756022b1 Mon Sep 17 00:00:00 2001 From: Dmitry Zbarski Date: Thu, 13 Feb 2020 20:50:42 +0200 Subject: [PATCH 2/5] Add tests for kubernetes cluster node labels --- .../data_source_kubernetes_cluster_test.go | 39 +++++++ ...e_arm_kubernetes_cluster_node_pool_test.go | 103 ++++++++++++++++++ ...ource_arm_kubernetes_cluster_other_test.go | 79 ++++++++++++++ .../resource_arm_kubernetes_cluster_test.go | 3 + 4 files changed, 224 insertions(+) diff --git a/azurerm/internal/services/containers/tests/data_source_kubernetes_cluster_test.go b/azurerm/internal/services/containers/tests/data_source_kubernetes_cluster_test.go index 1a4dc9810faf..dbaebd52f78d 100644 --- a/azurerm/internal/services/containers/tests/data_source_kubernetes_cluster_test.go +++ b/azurerm/internal/services/containers/tests/data_source_kubernetes_cluster_test.go @@ -596,6 +596,33 @@ func testAccDataSourceAzureRMKubernetesCluster_autoscalingWithAvailabilityZones( }) } +func TestAccDataSourceAzureRMKubernetesCluster_nodeLabels(t *testing.T) { + checkIfShouldRunTestsIndividually(t) + testAccDataSourceAzureRMKubernetesCluster_nodeLabels(t) +} + +func testAccDataSourceAzureRMKubernetesCluster_nodeLabels(t *testing.T) { + data := acceptance.BuildTestData(t, "data.azurerm_kubernetes_cluster", "test") + clientId := os.Getenv("ARM_CLIENT_ID") + clientSecret := os.Getenv("ARM_CLIENT_SECRET") + labels := map[string]string{"key": "value"} + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMKubernetesClusterDestroy, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceAzureRMKubernetesCluster_nodeLabelsConfig(data, clientId, clientSecret, labels), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMKubernetesClusterExists(data.ResourceName), + resource.TestCheckResourceAttr(data.ResourceName, "agent_pool_profile.1.node_labels.key", "value"), + ), + }, + }, + }) +} + func TestAccDataSourceAzureRMKubernetesCluster_nodeTaints(t *testing.T) { checkIfShouldRunTestsIndividually(t) testAccDataSourceAzureRMKubernetesCluster_nodeTaints(t) @@ -864,6 +891,18 @@ data "azurerm_kubernetes_cluster" "test" { `, r) } +func testAccDataSourceAzureRMKubernetesCluster_nodeLabelsConfig(data acceptance.TestData, clientId string, clientSecret string, labels map[string]string) string { + r := testAccAzureRMKubernetesCluster_nodeLabelsConfig(data, clientId, clientSecret, labels) + return fmt.Sprintf(` +%s + +data "azurerm_kubernetes_cluster" "test" { + name = "${azurerm_kubernetes_cluster.test.name}" + resource_group_name = "${azurerm_kubernetes_cluster.test.resource_group_name}" +} +`, r) +} + func testAccDataSourceAzureRMKubernetesCluster_nodeTaintsConfig(data acceptance.TestData, clientId string, clientSecret string) string { r := testAccAzureRMKubernetesCluster_nodeTaintsConfig(data, clientId, clientSecret) return fmt.Sprintf(` diff --git a/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_node_pool_test.go b/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_node_pool_test.go index 3bc04511a773..dc46998b7aaf 100644 --- a/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_node_pool_test.go +++ b/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_node_pool_test.go @@ -4,7 +4,9 @@ import ( "fmt" "net/http" "os" + "reflect" "regexp" + "strings" "testing" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" @@ -372,6 +374,46 @@ func testAccAzureRMKubernetesClusterNodePool_manualScaleVMSku(t *testing.T) { }) } +func TestAccAzureRMKubernetesClusterNodePool_nodeLabels(t *testing.T) { + checkIfShouldRunTestsIndividually(t) + testAccAzureRMKubernetesClusterNodePool_nodeLabelds(t) +} + +func testAccAzureRMKubernetesClusterNodePool_nodeLabelds(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster_node_pool", "test") + clientId := os.Getenv("ARM_CLIENT_ID") + clientSecret := os.Getenv("ARM_CLIENT_SECRET") + labels1 := map[string]string{"key": "value"} + labels2 := map[string]string{"key2": "value2"} + labels3 := map[string]string{} + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMKubernetesClusterNodePoolDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMKubernetesClusterNodePool_nodeLabelsConfig(data, clientId, clientSecret, labels1), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMKubernetesNodePoolNodeLabels(data.ResourceName, labels1), + ), + }, + { + Config: testAccAzureRMKubernetesClusterNodePool_nodeLabelsConfig(data, clientId, clientSecret, labels2), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMKubernetesNodePoolNodeLabels(data.ResourceName, labels1), + ), + }, + { + Config: testAccAzureRMKubernetesClusterNodePool_nodeLabelsConfig(data, clientId, clientSecret, labels3), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMKubernetesNodePoolNodeLabels(data.ResourceName, labels1), + ), + }, + }, + }) +} + func TestAccAzureRMKubernetesClusterNodePool_nodePublicIP(t *testing.T) { checkIfShouldRunTestsIndividually(t) testAccAzureRMKubernetesClusterNodePool_nodePublicIP(t) @@ -659,6 +701,45 @@ func testCheckAzureRMKubernetesNodePoolExists(resourceName string) resource.Test } } +func testCheckAzureRMKubernetesNodePoolNodeLabels(resourceName string, expectedLabels map[string]string) resource.TestCheckFunc { + return func(s *terraform.State) error { + client := acceptance.AzureProvider.Meta().(*clients.Client).Containers.AgentPoolsClient + ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext + + // Ensure we have enough information in state to look up in API + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("Not found: %s", resourceName) + } + + name := rs.Primary.Attributes["name"] + kubernetesClusterId := rs.Primary.Attributes["kubernetes_cluster_id"] + parsedK8sId, err := containers.ParseKubernetesClusterID(kubernetesClusterId) + if err != nil { + return fmt.Errorf("Error parsing kubernetes cluster id: %+v", err) + } + + agent_pool, err := client.Get(ctx, parsedK8sId.ResourceGroup, parsedK8sId.Name, name) + if err != nil { + return fmt.Errorf("Bad: Get on kubernetesClustersClient: %+v", err) + } + + if agent_pool.StatusCode == http.StatusNotFound { + return fmt.Errorf("Bad: Node Pool %q (Kubernetes Cluster %q / Resource Group: %q) does not exist", name, parsedK8sId.Name, parsedK8sId.ResourceGroup) + } + + labels := make(map[string]string) + for k, v := range agent_pool.NodeLabels { + labels[k] = *v + } + if !reflect.DeepEqual(labels, expectedLabels) { + return fmt.Errorf("Bad: Node Pool %q (Kubernetes Cluster %q / Resource Group: %q) nodeLabels %v do not match expected %v", name, parsedK8sId.Name, parsedK8sId.ResourceGroup, labels, expectedLabels) + } + + return nil + } +} + func testAccAzureRMKubernetesClusterNodePool_autoScaleConfig(data acceptance.TestData, clientId, clientSecret string) string { template := testAccAzureRMKubernetesClusterNodePool_templateConfig(data, clientId, clientSecret) return fmt.Sprintf(` @@ -890,6 +971,28 @@ resource "azurerm_kubernetes_cluster_node_pool" "manual" { `, template, numberOfAgents) } +func testAccAzureRMKubernetesClusterNodePool_nodeLabelsConfig(data acceptance.TestData, clientId, clientSecret string, labels map[string]string) string { + template := testAccAzureRMKubernetesClusterNodePool_templateConfig(data, clientId, clientSecret) + labelsSlice := make([]string, 0, len(labels)) + for k, v := range labels { + labelsSlice = append(labelsSlice, fmt.Sprintf(" \"%s\" = \"%s\"", k, v)) + } + labelsStr := strings.Join(labelsSlice, "\n") + return fmt.Sprintf(` +%s + +resource "azurerm_kubernetes_cluster_node_pool" "test" { + name = "internal" + kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id + vm_size = "Standard_DS2_v2" + node_count = 1 + node_labels = { +%s + } +} +`, template, labelsStr) +} + func testAccAzureRMKubernetesClusterNodePool_nodePublicIPConfig(data acceptance.TestData, clientId, clientSecret string) string { template := testAccAzureRMKubernetesClusterNodePool_templateConfig(data, clientId, clientSecret) return fmt.Sprintf(` diff --git a/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_other_test.go b/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_other_test.go index 51c16d42bf57..aa8f1a472bb5 100644 --- a/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_other_test.go +++ b/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_other_test.go @@ -3,6 +3,7 @@ package tests import ( "fmt" "os" + "strings" "testing" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" @@ -153,6 +154,49 @@ func testAccAzureRMKubernetesCluster_linuxProfile(t *testing.T) { }) } +func TestAccAzureRMKubernetesCluster_nodeLabels(t *testing.T) { + checkIfShouldRunTestsIndividually(t) + testAccAzureRMKubernetesCluster_nodeTaints(t) +} + +func testAccAzureRMKubernetesCluster_nodeLabels(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster", "test") + clientId := os.Getenv("ARM_CLIENT_ID") + clientSecret := os.Getenv("ARM_CLIENT_SECRET") + labels1 := map[string]string{"key": "value"} + labels2 := map[string]string{"key2": "value2"} + labels3 := map[string]string{} + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMKubernetesClusterDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMKubernetesCluster_nodeLabelsConfig(data, clientId, clientSecret, labels1), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMKubernetesClusterExists(data.ResourceName), + resource.TestCheckResourceAttr(data.ResourceName, "default_node_pool.0.node_labels.key", "value"), + ), + }, + { + Config: testAccAzureRMKubernetesCluster_nodeLabelsConfig(data, clientId, clientSecret, labels2), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMKubernetesClusterExists(data.ResourceName), + resource.TestCheckResourceAttr(data.ResourceName, "default_node_pool.0.node_labels.key2", "value2"), + ), + }, + { + Config: testAccAzureRMKubernetesCluster_nodeLabelsConfig(data, clientId, clientSecret, labels3), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMKubernetesClusterExists(data.ResourceName), + resource.TestCheckNoResourceAttr(data.ResourceName, "default_node_pool.0.node_labels"), + ), + }, + }, + }) +} + func TestAccAzureRMKubernetesCluster_nodeTaints(t *testing.T) { checkIfShouldRunTestsIndividually(t) testAccAzureRMKubernetesCluster_nodeTaints(t) @@ -425,6 +469,41 @@ resource "azurerm_kubernetes_cluster" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger, clientId, clientSecret) } +func testAccAzureRMKubernetesCluster_nodeLabelsConfig(data acceptance.TestData, clientId string, clientSecret string, labels map[string]string) string { + labelsSlice := make([]string, 0, len(labels)) + for k, v := range labels { + labelsSlice = append(labelsSlice, fmt.Sprintf(" \"%s\" = \"%s\"", k, v)) + } + labelsStr := strings.Join(labelsSlice, "\n") + return fmt.Sprintf(` +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} + +resource "azurerm_kubernetes_cluster" "test" { + name = "acctestaks%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + dns_prefix = "acctestaks%d" + + default_node_pool { + name = "default" + node_count = 1 + vm_size = "Standard_DS2_v2" + node_labels = [ +%s + ] + } + + service_principal { + client_id = "%s" + client_secret = "%s" + } +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, labelsStr, clientId, clientSecret) +} + func testAccAzureRMKubernetesCluster_nodeTaintsConfig(data acceptance.TestData, clientId string, clientSecret string) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { diff --git a/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_test.go b/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_test.go index bee56efc903c..e5fa96a1234a 100644 --- a/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_test.go +++ b/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_test.go @@ -67,6 +67,7 @@ func TestAccAzureRMKubernetes_all(t *testing.T) { "manualScaleMultiplePoolsUpdate": testAccAzureRMKubernetesClusterNodePool_manualScaleMultiplePoolsUpdate, "manualScaleUpdate": testAccAzureRMKubernetesClusterNodePool_manualScaleUpdate, "manualScaleVMSku": testAccAzureRMKubernetesClusterNodePool_manualScaleVMSku, + "nodeLabels": TestAccAzureRMKubernetesClusterNodePool_nodeLabels, "nodePublicIP": testAccAzureRMKubernetesClusterNodePool_nodePublicIP, "nodeTaints": testAccAzureRMKubernetesClusterNodePool_nodeTaints, "requiresImport": testAccAzureRMKubernetesClusterNodePool_requiresImport, @@ -81,6 +82,7 @@ func TestAccAzureRMKubernetes_all(t *testing.T) { "basicVMSS": testAccAzureRMKubernetesCluster_basicVMSS, "requiresImport": testAccAzureRMKubernetesCluster_requiresImport, "linuxProfile": testAccAzureRMKubernetesCluster_linuxProfile, + "nodeLabels": testAccAzureRMKubernetesCluster_nodeLabels, "nodeTaints": testAccAzureRMKubernetesCluster_nodeTaints, "nodeResourceGroup": testAccAzureRMKubernetesCluster_nodeResourceGroup, "upgradeConfig": testAccAzureRMKubernetesCluster_upgrade, @@ -115,6 +117,7 @@ func TestAccAzureRMKubernetes_all(t *testing.T) { "addOnProfileRouting": testAccDataSourceAzureRMKubernetesCluster_addOnProfileRouting, "autoscalingNoAvailabilityZones": testAccDataSourceAzureRMKubernetesCluster_autoscalingNoAvailabilityZones, "autoscalingWithAvailabilityZones": testAccDataSourceAzureRMKubernetesCluster_autoscalingWithAvailabilityZones, + "nodeLabels": TestAccDataSourceAzureRMKubernetesCluster_nodeLabels, "nodeTaints": testAccDataSourceAzureRMKubernetesCluster_nodeTaints, "enableNodePublicIP": testAccDataSourceAzureRMKubernetesCluster_enableNodePublicIP, "privateLink": testAccDataSourceAzureRMKubernetesCluster_privateLink, From ad7b0de3d9121d6c47d0c35004edf9d493ecafe9 Mon Sep 17 00:00:00 2001 From: Matthew Frahry Date: Wed, 4 Mar 2020 15:35:59 -0800 Subject: [PATCH 3/5] Update resource_arm_kubernetes_cluster_node_pool_test.go Fixing test --- .../tests/resource_arm_kubernetes_cluster_node_pool_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_node_pool_test.go b/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_node_pool_test.go index dc46998b7aaf..95c88b83f594 100644 --- a/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_node_pool_test.go +++ b/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_node_pool_test.go @@ -401,13 +401,13 @@ func testAccAzureRMKubernetesClusterNodePool_nodeLabelds(t *testing.T) { { Config: testAccAzureRMKubernetesClusterNodePool_nodeLabelsConfig(data, clientId, clientSecret, labels2), Check: resource.ComposeTestCheckFunc( - testCheckAzureRMKubernetesNodePoolNodeLabels(data.ResourceName, labels1), + testCheckAzureRMKubernetesNodePoolNodeLabels(data.ResourceName, labels2), ), }, { Config: testAccAzureRMKubernetesClusterNodePool_nodeLabelsConfig(data, clientId, clientSecret, labels3), Check: resource.ComposeTestCheckFunc( - testCheckAzureRMKubernetesNodePoolNodeLabels(data.ResourceName, labels1), + testCheckAzureRMKubernetesNodePoolNodeLabels(data.ResourceName, labels3), ), }, }, From 4d0198a768a5587eb2058790fadef3fc30af9b03 Mon Sep 17 00:00:00 2001 From: Dmitry Zbarski Date: Mon, 9 Mar 2020 12:11:50 +0200 Subject: [PATCH 4/5] Fix tests --- .../containers/tests/data_source_kubernetes_cluster_test.go | 2 +- .../tests/resource_arm_kubernetes_cluster_other_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/azurerm/internal/services/containers/tests/data_source_kubernetes_cluster_test.go b/azurerm/internal/services/containers/tests/data_source_kubernetes_cluster_test.go index dbaebd52f78d..5f2fd8de1502 100644 --- a/azurerm/internal/services/containers/tests/data_source_kubernetes_cluster_test.go +++ b/azurerm/internal/services/containers/tests/data_source_kubernetes_cluster_test.go @@ -616,7 +616,7 @@ func testAccDataSourceAzureRMKubernetesCluster_nodeLabels(t *testing.T) { Config: testAccDataSourceAzureRMKubernetesCluster_nodeLabelsConfig(data, clientId, clientSecret, labels), Check: resource.ComposeTestCheckFunc( testCheckAzureRMKubernetesClusterExists(data.ResourceName), - resource.TestCheckResourceAttr(data.ResourceName, "agent_pool_profile.1.node_labels.key", "value"), + resource.TestCheckResourceAttr(data.ResourceName, "agent_pool_profile.0.node_labels.key", "value"), ), }, }, diff --git a/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_other_test.go b/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_other_test.go index aa8f1a472bb5..e7cb115960a8 100644 --- a/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_other_test.go +++ b/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_other_test.go @@ -156,7 +156,7 @@ func testAccAzureRMKubernetesCluster_linuxProfile(t *testing.T) { func TestAccAzureRMKubernetesCluster_nodeLabels(t *testing.T) { checkIfShouldRunTestsIndividually(t) - testAccAzureRMKubernetesCluster_nodeTaints(t) + testAccAzureRMKubernetesCluster_nodeLabels(t) } func testAccAzureRMKubernetesCluster_nodeLabels(t *testing.T) { @@ -491,9 +491,9 @@ resource "azurerm_kubernetes_cluster" "test" { name = "default" node_count = 1 vm_size = "Standard_DS2_v2" - node_labels = [ + node_labels = { %s - ] + } } service_principal { From 80c7d5da67e57c67002af26d056fe8eeca69d0ec Mon Sep 17 00:00:00 2001 From: Matthew Frahry Date: Mon, 9 Mar 2020 19:54:07 -0700 Subject: [PATCH 5/5] Update resource_arm_kubernetes_cluster_test.go --- .../containers/tests/resource_arm_kubernetes_cluster_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_test.go b/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_test.go index e5fa96a1234a..394407aa20f2 100644 --- a/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_test.go +++ b/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_test.go @@ -117,7 +117,7 @@ func TestAccAzureRMKubernetes_all(t *testing.T) { "addOnProfileRouting": testAccDataSourceAzureRMKubernetesCluster_addOnProfileRouting, "autoscalingNoAvailabilityZones": testAccDataSourceAzureRMKubernetesCluster_autoscalingNoAvailabilityZones, "autoscalingWithAvailabilityZones": testAccDataSourceAzureRMKubernetesCluster_autoscalingWithAvailabilityZones, - "nodeLabels": TestAccDataSourceAzureRMKubernetesCluster_nodeLabels, + "nodeLabels": testAccDataSourceAzureRMKubernetesCluster_nodeLabels, "nodeTaints": testAccDataSourceAzureRMKubernetesCluster_nodeTaints, "enableNodePublicIP": testAccDataSourceAzureRMKubernetesCluster_enableNodePublicIP, "privateLink": testAccDataSourceAzureRMKubernetesCluster_privateLink,