@@ -232,6 +232,31 @@ func TestAccContainerCluster_withNodeConfig(t *testing.T) {
232
232
})
233
233
}
234
234
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
+
235
260
func TestAccContainerCluster_withNodeConfigScopeAlias (t * testing.T ) {
236
261
t .Parallel ()
237
262
@@ -978,6 +1003,40 @@ resource "google_container_cluster" "with_version" {
978
1003
}` , clusterName )
979
1004
}
980
1005
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
+
981
1040
var testAccContainerCluster_withNodeConfig = fmt .Sprintf (`
982
1041
resource "google_container_cluster" "with_node_config" {
983
1042
name = "cluster-test-%s"
0 commit comments