Skip to content

Commit 26944d0

Browse files
author
Sébastien GLON
committed
replalce TypeList by TypeSet
1 parent 45ebda0 commit 26944d0

File tree

2 files changed

+60
-1
lines changed

2 files changed

+60
-1
lines changed

google/node_config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package google
33
import (
44
"github.com/hashicorp/terraform/helper/schema"
55
"github.com/hashicorp/terraform/helper/validation"
6-
"google.golang.org/api/container/v1"
6+
container "google.golang.org/api/container/v1"
77
)
88

99
var schemaNodeConfig = &schema.Schema{

google/resource_container_cluster_test.go

+59
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,31 @@ func TestAccContainerCluster_withNodeConfig(t *testing.T) {
232232
})
233233
}
234234

235+
func TestAccContainerCluster_withNodeConfigNotSorted(t *testing.T) {
236+
// Make an update with non sorted oauth_scopes
237+
resource.Test(t, resource.TestCase{
238+
PreCheck: func() { testAccPreCheck(t) },
239+
Providers: testAccProviders,
240+
CheckDestroy: testAccCheckContainerClusterDestroy,
241+
Steps: []resource.TestStep{
242+
{
243+
Config: testAccContainerCluster_withNodeConfigNotsorted,
244+
Check: resource.ComposeTestCheckFunc(
245+
testAccCheckContainerCluster(
246+
"google_container_cluster.with_node_config_not_sorted"),
247+
),
248+
},
249+
{
250+
Config: testAccContainerCluster_withNodeConfigNotsorted,
251+
Check: resource.ComposeTestCheckFunc(
252+
testAccCheckContainerCluster(
253+
"google_container_cluster.with_node_config_not_sorted"),
254+
),
255+
},
256+
},
257+
})
258+
}
259+
235260
func TestAccContainerCluster_withNodeConfigScopeAlias(t *testing.T) {
236261
t.Parallel()
237262

@@ -978,6 +1003,40 @@ resource "google_container_cluster" "with_version" {
9781003
}`, clusterName)
9791004
}
9801005

1006+
var testAccContainerCluster_withNodeConfigNotsorted = fmt.Sprintf(`
1007+
resource "google_container_cluster" "with_node_config_not_sorted" {
1008+
name = "cluster-test-%s"
1009+
zone = "us-central1-f"
1010+
initial_node_count = 1
1011+
1012+
master_auth {
1013+
username = "mr.yoda"
1014+
password = "adoy.rm"
1015+
}
1016+
1017+
node_config {
1018+
machine_type = "n1-standard-1"
1019+
disk_size_gb = 15
1020+
local_ssd_count = 1
1021+
oauth_scopes = [
1022+
"https://www.googleapis.com/auth/compute",
1023+
"https://www.googleapis.com/auth/devstorage.read_only",
1024+
"https://www.googleapis.com/auth/logging.write",
1025+
"monitoring"
1026+
]
1027+
service_account = "default"
1028+
metadata {
1029+
foo = "bar"
1030+
}
1031+
image_type = "COS"
1032+
labels {
1033+
foo = "bar"
1034+
}
1035+
tags = ["foo", "bar"]
1036+
preemptible = true
1037+
}
1038+
}`, acctest.RandString(10))
1039+
9811040
var testAccContainerCluster_withNodeConfig = fmt.Sprintf(`
9821041
resource "google_container_cluster" "with_node_config" {
9831042
name = "cluster-test-%s"

0 commit comments

Comments
 (0)