Skip to content

Commit

Permalink
replalce TypeList by TypeSet
Browse files Browse the repository at this point in the history
  • Loading branch information
Sébastien GLON committed Oct 26, 2017
1 parent 45ebda0 commit 26944d0
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
2 changes: 1 addition & 1 deletion google/node_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package google
import (
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"google.golang.org/api/container/v1"
container "google.golang.org/api/container/v1"
)

var schemaNodeConfig = &schema.Schema{
Expand Down
59 changes: 59 additions & 0 deletions google/resource_container_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,31 @@ func TestAccContainerCluster_withNodeConfig(t *testing.T) {
})
}

func TestAccContainerCluster_withNodeConfigNotSorted(t *testing.T) {
// Make an update with non sorted oauth_scopes
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckContainerClusterDestroy,
Steps: []resource.TestStep{
{
Config: testAccContainerCluster_withNodeConfigNotsorted,
Check: resource.ComposeTestCheckFunc(
testAccCheckContainerCluster(
"google_container_cluster.with_node_config_not_sorted"),
),
},
{
Config: testAccContainerCluster_withNodeConfigNotsorted,
Check: resource.ComposeTestCheckFunc(
testAccCheckContainerCluster(
"google_container_cluster.with_node_config_not_sorted"),
),
},
},
})
}

func TestAccContainerCluster_withNodeConfigScopeAlias(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -978,6 +1003,40 @@ resource "google_container_cluster" "with_version" {
}`, clusterName)
}

var testAccContainerCluster_withNodeConfigNotsorted = fmt.Sprintf(`
resource "google_container_cluster" "with_node_config_not_sorted" {
name = "cluster-test-%s"
zone = "us-central1-f"
initial_node_count = 1
master_auth {
username = "mr.yoda"
password = "adoy.rm"
}
node_config {
machine_type = "n1-standard-1"
disk_size_gb = 15
local_ssd_count = 1
oauth_scopes = [
"https://www.googleapis.com/auth/compute",
"https://www.googleapis.com/auth/devstorage.read_only",
"https://www.googleapis.com/auth/logging.write",
"monitoring"
]
service_account = "default"
metadata {
foo = "bar"
}
image_type = "COS"
labels {
foo = "bar"
}
tags = ["foo", "bar"]
preemptible = true
}
}`, acctest.RandString(10))

var testAccContainerCluster_withNodeConfig = fmt.Sprintf(`
resource "google_container_cluster" "with_node_config" {
name = "cluster-test-%s"
Expand Down

0 comments on commit 26944d0

Please sign in to comment.