@@ -3927,55 +3927,56 @@ func TestAccContainerCluster_withLoggingConfig(t *testing.T) {
3927
3927
clusterName := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(t, 10))
3928
3928
networkName := acctest.BootstrapSharedTestNetwork(t, "gke-cluster")
3929
3929
subnetworkName := acctest.BootstrapSubnet(t, "gke-cluster", networkName)
3930
+ minVersion := "1.32"
3930
3931
acctest.VcrTest(t, resource.TestCase{
3931
3932
PreCheck: func() { acctest.AccTestPreCheck(t) },
3932
3933
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
3933
3934
CheckDestroy: testAccCheckContainerClusterDestroyProducer(t),
3934
3935
Steps: []resource.TestStep{
3935
3936
{
3936
- Config: testAccContainerCluster_basic (clusterName, networkName, subnetworkName),
3937
+ Config: testAccContainerCluster_basicWithMinGKEVersion (clusterName, networkName, subnetworkName, minVersion ),
3937
3938
},
3938
3939
{
3939
3940
ResourceName: "google_container_cluster.primary",
3940
3941
ImportState: true,
3941
3942
ImportStateVerify: true,
3942
- ImportStateVerifyIgnore: []string{"deletion_protection"},
3943
+ ImportStateVerifyIgnore: []string{"min_master_version", " deletion_protection"},
3943
3944
},
3944
3945
{
3945
- Config: testAccContainerCluster_withLoggingConfigEnabled(clusterName, networkName, subnetworkName),
3946
+ Config: testAccContainerCluster_withLoggingConfigEnabled(clusterName, networkName, subnetworkName, minVersion ),
3946
3947
},
3947
3948
{
3948
3949
ResourceName: "google_container_cluster.primary",
3949
3950
ImportState: true,
3950
3951
ImportStateVerify: true,
3951
- ImportStateVerifyIgnore: []string{"deletion_protection"},
3952
+ ImportStateVerifyIgnore: []string{"min_master_version", " deletion_protection"},
3952
3953
},
3953
3954
{
3954
- Config: testAccContainerCluster_withLoggingConfigDisabled(clusterName, networkName, subnetworkName),
3955
+ Config: testAccContainerCluster_withLoggingConfigDisabled(clusterName, networkName, subnetworkName, minVersion ),
3955
3956
},
3956
3957
{
3957
3958
ResourceName: "google_container_cluster.primary",
3958
3959
ImportState: true,
3959
3960
ImportStateVerify: true,
3960
- ImportStateVerifyIgnore: []string{"deletion_protection"},
3961
+ ImportStateVerifyIgnore: []string{"min_master_version", " deletion_protection"},
3961
3962
},
3962
3963
{
3963
- Config: testAccContainerCluster_withLoggingConfigUpdated(clusterName, networkName, subnetworkName),
3964
+ Config: testAccContainerCluster_withLoggingConfigUpdated(clusterName, networkName, subnetworkName, minVersion ),
3964
3965
},
3965
3966
{
3966
3967
ResourceName: "google_container_cluster.primary",
3967
3968
ImportState: true,
3968
3969
ImportStateVerify: true,
3969
- ImportStateVerifyIgnore: []string{"deletion_protection"},
3970
+ ImportStateVerifyIgnore: []string{"min_master_version", " deletion_protection"},
3970
3971
},
3971
3972
{
3972
- Config: testAccContainerCluster_basic (clusterName, networkName, subnetworkName),
3973
+ Config: testAccContainerCluster_basicWithMinGKEVersion (clusterName, networkName, subnetworkName, minVersion ),
3973
3974
},
3974
3975
{
3975
3976
ResourceName: "google_container_cluster.primary",
3976
3977
ImportState: true,
3977
3978
ImportStateVerify: true,
3978
- ImportStateVerifyIgnore: []string{"deletion_protection"},
3979
+ ImportStateVerifyIgnore: []string{"min_master_version", " deletion_protection"},
3979
3980
},
3980
3981
},
3981
3982
})
@@ -6310,6 +6311,21 @@ resource "google_container_cluster" "primary" {
6310
6311
`, name, networkName, subnetworkName)
6311
6312
}
6312
6313
6314
+ func testAccContainerCluster_basicWithMinGKEVersion(name, networkName, subnetworkName string, minVersion string) string {
6315
+ return fmt.Sprintf(`
6316
+ resource "google_container_cluster" "primary" {
6317
+ name = "%s"
6318
+ location = "us-central1-a"
6319
+ initial_node_count = 1
6320
+ network = "%s"
6321
+ subnetwork = "%s"
6322
+ min_master_version = "%s"
6323
+
6324
+ deletion_protection = false
6325
+ }
6326
+ `, name, networkName, subnetworkName, minVersion)
6327
+ }
6328
+
6313
6329
func testAccContainerCluster_forSecretManagerConfig(projectID, name, networkName, subnetworkName string) string {
6314
6330
return fmt.Sprintf(`
6315
6331
data "google_project" "project" {
@@ -11003,7 +11019,7 @@ resource "google_container_cluster" "primary" {
11003
11019
`, projectID, name, networkName, subnetworkName)
11004
11020
}
11005
11021
11006
- func testAccContainerCluster_withLoggingConfigEnabled(name, networkName, subnetworkName string) string {
11022
+ func testAccContainerCluster_withLoggingConfigEnabled(name, networkName, subnetworkName string, minVersion string ) string {
11007
11023
return fmt.Sprintf(`
11008
11024
resource "google_container_cluster" "primary" {
11009
11025
name = "%s"
@@ -11018,11 +11034,12 @@ resource "google_container_cluster" "primary" {
11018
11034
deletion_protection = false
11019
11035
network = "%s"
11020
11036
subnetwork = "%s"
11037
+ min_master_version = "%s"
11021
11038
}
11022
- `, name, networkName, subnetworkName)
11039
+ `, name, networkName, subnetworkName, minVersion )
11023
11040
}
11024
11041
11025
- func testAccContainerCluster_withLoggingConfigDisabled(name, networkName, subnetworkName string) string {
11042
+ func testAccContainerCluster_withLoggingConfigDisabled(name, networkName, subnetworkName string, minVersion string ) string {
11026
11043
return fmt.Sprintf(`
11027
11044
resource "google_container_cluster" "primary" {
11028
11045
name = "%s"
@@ -11034,27 +11051,29 @@ resource "google_container_cluster" "primary" {
11034
11051
deletion_protection = false
11035
11052
network = "%s"
11036
11053
subnetwork = "%s"
11054
+ min_master_version = "%s"
11037
11055
}
11038
- `, name, networkName, subnetworkName)
11056
+ `, name, networkName, subnetworkName, minVersion )
11039
11057
}
11040
11058
11041
- func testAccContainerCluster_withLoggingConfigUpdated(name, networkName, subnetworkName string) string {
11059
+ func testAccContainerCluster_withLoggingConfigUpdated(name, networkName, subnetworkName string, minVersion string ) string {
11042
11060
return fmt.Sprintf(`
11043
11061
resource "google_container_cluster" "primary" {
11044
11062
name = "%s"
11045
11063
location = "us-central1-a"
11046
11064
initial_node_count = 1
11047
11065
logging_config {
11048
- enable_components = [ "SYSTEM_COMPONENTS", "APISERVER", "CONTROLLER_MANAGER", "SCHEDULER", "KCP_CONNECTION", "KCP_SSHD"]
11066
+ enable_components = [ "SYSTEM_COMPONENTS", "APISERVER", "CONTROLLER_MANAGER", "SCHEDULER", "KCP_CONNECTION", "KCP_SSHD", "KCP_HPA" ]
11049
11067
}
11050
11068
monitoring_config {
11051
11069
enable_components = [ "SYSTEM_COMPONENTS" ]
11052
11070
}
11053
11071
deletion_protection = false
11054
11072
network = "%s"
11055
11073
subnetwork = "%s"
11074
+ min_master_version = "%s"
11056
11075
}
11057
- `, name, networkName, subnetworkName)
11076
+ `, name, networkName, subnetworkName, minVersion )
11058
11077
}
11059
11078
11060
11079
func testAccContainerCluster_withMonitoringConfigEnabled(name, networkName, subnetworkName string) string {
0 commit comments