@@ -3784,55 +3784,56 @@ func TestAccContainerCluster_withLoggingConfig(t *testing.T) {
3784
3784
clusterName := fmt .Sprintf ("tf-test-cluster-%s" , acctest .RandString (t , 10 ))
3785
3785
networkName := acctest .BootstrapSharedTestNetwork (t , "gke-cluster" )
3786
3786
subnetworkName := acctest .BootstrapSubnet (t , "gke-cluster" , networkName )
3787
+ minVersion := "1.32"
3787
3788
acctest .VcrTest (t , resource.TestCase {
3788
3789
PreCheck : func () { acctest .AccTestPreCheck (t ) },
3789
3790
ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories (t ),
3790
3791
CheckDestroy : testAccCheckContainerClusterDestroyProducer (t ),
3791
3792
Steps : []resource.TestStep {
3792
3793
{
3793
- Config : testAccContainerCluster_basic (clusterName , networkName , subnetworkName ),
3794
+ Config : testAccContainerCluster_basicWithMinGKEVersion (clusterName , networkName , subnetworkName , minVersion ),
3794
3795
},
3795
3796
{
3796
3797
ResourceName : "google_container_cluster.primary" ,
3797
3798
ImportState : true ,
3798
3799
ImportStateVerify : true ,
3799
- ImportStateVerifyIgnore : []string {"deletion_protection" },
3800
+ ImportStateVerifyIgnore : []string {"min_master_version" , " deletion_protection" },
3800
3801
},
3801
3802
{
3802
- Config : testAccContainerCluster_withLoggingConfigEnabled (clusterName , networkName , subnetworkName ),
3803
+ Config : testAccContainerCluster_withLoggingConfigEnabled (clusterName , networkName , subnetworkName , minVersion ),
3803
3804
},
3804
3805
{
3805
3806
ResourceName : "google_container_cluster.primary" ,
3806
3807
ImportState : true ,
3807
3808
ImportStateVerify : true ,
3808
- ImportStateVerifyIgnore : []string {"deletion_protection" },
3809
+ ImportStateVerifyIgnore : []string {"min_master_version" , " deletion_protection" },
3809
3810
},
3810
3811
{
3811
- Config : testAccContainerCluster_withLoggingConfigDisabled (clusterName , networkName , subnetworkName ),
3812
+ Config : testAccContainerCluster_withLoggingConfigDisabled (clusterName , networkName , subnetworkName , minVersion ),
3812
3813
},
3813
3814
{
3814
3815
ResourceName : "google_container_cluster.primary" ,
3815
3816
ImportState : true ,
3816
3817
ImportStateVerify : true ,
3817
- ImportStateVerifyIgnore : []string {"deletion_protection" },
3818
+ ImportStateVerifyIgnore : []string {"min_master_version" , " deletion_protection" },
3818
3819
},
3819
3820
{
3820
- Config : testAccContainerCluster_withLoggingConfigUpdated (clusterName , networkName , subnetworkName ),
3821
+ Config : testAccContainerCluster_withLoggingConfigUpdated (clusterName , networkName , subnetworkName , minVersion ),
3821
3822
},
3822
3823
{
3823
3824
ResourceName : "google_container_cluster.primary" ,
3824
3825
ImportState : true ,
3825
3826
ImportStateVerify : true ,
3826
- ImportStateVerifyIgnore : []string {"deletion_protection" },
3827
+ ImportStateVerifyIgnore : []string {"min_master_version" , " deletion_protection" },
3827
3828
},
3828
3829
{
3829
- Config : testAccContainerCluster_basic (clusterName , networkName , subnetworkName ),
3830
+ Config : testAccContainerCluster_basicWithMinGKEVersion (clusterName , networkName , subnetworkName , minVersion ),
3830
3831
},
3831
3832
{
3832
3833
ResourceName : "google_container_cluster.primary" ,
3833
3834
ImportState : true ,
3834
3835
ImportStateVerify : true ,
3835
- ImportStateVerifyIgnore : []string {"deletion_protection" },
3836
+ ImportStateVerifyIgnore : []string {"min_master_version" , " deletion_protection" },
3836
3837
},
3837
3838
},
3838
3839
})
@@ -5854,6 +5855,21 @@ resource "google_container_cluster" "primary" {
5854
5855
` , name , networkName , subnetworkName )
5855
5856
}
5856
5857
5858
+ func testAccContainerCluster_basicWithMinGKEVersion (name , networkName , subnetworkName string , minVersion string ) string {
5859
+ return fmt .Sprintf (`
5860
+ resource "google_container_cluster" "primary" {
5861
+ name = "%s"
5862
+ location = "us-central1-a"
5863
+ initial_node_count = 1
5864
+ network = "%s"
5865
+ subnetwork = "%s"
5866
+ min_master_version = "%s"
5867
+
5868
+ deletion_protection = false
5869
+ }
5870
+ ` , name , networkName , subnetworkName , minVersion )
5871
+ }
5872
+
5857
5873
func testAccContainerCluster_forSecretManagerConfig (projectID , name , networkName , subnetworkName string ) string {
5858
5874
return fmt .Sprintf (`
5859
5875
data "google_project" "project" {
@@ -10145,7 +10161,7 @@ resource "google_container_cluster" "primary" {
10145
10161
` , projectID , name , networkName , subnetworkName )
10146
10162
}
10147
10163
10148
- func testAccContainerCluster_withLoggingConfigEnabled (name , networkName , subnetworkName string ) string {
10164
+ func testAccContainerCluster_withLoggingConfigEnabled (name , networkName , subnetworkName string , minVersion string ) string {
10149
10165
return fmt .Sprintf (`
10150
10166
resource "google_container_cluster" "primary" {
10151
10167
name = "%s"
@@ -10160,11 +10176,12 @@ resource "google_container_cluster" "primary" {
10160
10176
deletion_protection = false
10161
10177
network = "%s"
10162
10178
subnetwork = "%s"
10179
+ min_master_version = "%s"
10163
10180
}
10164
- ` , name , networkName , subnetworkName )
10181
+ ` , name , networkName , subnetworkName , minVersion )
10165
10182
}
10166
10183
10167
- func testAccContainerCluster_withLoggingConfigDisabled (name , networkName , subnetworkName string ) string {
10184
+ func testAccContainerCluster_withLoggingConfigDisabled (name , networkName , subnetworkName string , minVersion string ) string {
10168
10185
return fmt .Sprintf (`
10169
10186
resource "google_container_cluster" "primary" {
10170
10187
name = "%s"
@@ -10176,27 +10193,29 @@ resource "google_container_cluster" "primary" {
10176
10193
deletion_protection = false
10177
10194
network = "%s"
10178
10195
subnetwork = "%s"
10196
+ min_master_version = "%s"
10179
10197
}
10180
- ` , name , networkName , subnetworkName )
10198
+ ` , name , networkName , subnetworkName , minVersion )
10181
10199
}
10182
10200
10183
- func testAccContainerCluster_withLoggingConfigUpdated (name , networkName , subnetworkName string ) string {
10201
+ func testAccContainerCluster_withLoggingConfigUpdated (name , networkName , subnetworkName string , minVersion string ) string {
10184
10202
return fmt .Sprintf (`
10185
10203
resource "google_container_cluster" "primary" {
10186
10204
name = "%s"
10187
10205
location = "us-central1-a"
10188
10206
initial_node_count = 1
10189
10207
logging_config {
10190
- enable_components = [ "SYSTEM_COMPONENTS", "APISERVER", "CONTROLLER_MANAGER", "SCHEDULER", "KCP_CONNECTION", "KCP_SSHD"]
10208
+ enable_components = [ "SYSTEM_COMPONENTS", "APISERVER", "CONTROLLER_MANAGER", "SCHEDULER", "KCP_CONNECTION", "KCP_SSHD", "KCP_HPA" ]
10191
10209
}
10192
10210
monitoring_config {
10193
10211
enable_components = [ "SYSTEM_COMPONENTS" ]
10194
10212
}
10195
10213
deletion_protection = false
10196
10214
network = "%s"
10197
10215
subnetwork = "%s"
10216
+ min_master_version = "%s"
10198
10217
}
10199
- ` , name , networkName , subnetworkName )
10218
+ ` , name , networkName , subnetworkName , minVersion )
10200
10219
}
10201
10220
10202
10221
func testAccContainerCluster_withMonitoringConfigEnabled (name , networkName , subnetworkName string ) string {
0 commit comments