@@ -928,7 +928,7 @@ func TestAccContainerNodePool_withKubeletConfig(t *testing.T) {
928
928
CheckDestroy : testAccCheckContainerClusterDestroyProducer (t ),
929
929
Steps : []resource.TestStep {
930
930
{
931
- Config : testAccContainerNodePool_withKubeletConfig (cluster , np , "static" , "100ms" , networkName , subnetworkName , "TRUE" , "100Mi" , "1m" , "10m" , true , 2048 , 10 , 10 , 85 ),
931
+ Config : testAccContainerNodePool_withKubeletConfig (cluster , np , "static" , "100ms" , networkName , subnetworkName , "TRUE" , "100Mi" , "1m" , "10m" , true , true , 2048 , 10 , 10 , 85 ),
932
932
ConfigPlanChecks : resource.ConfigPlanChecks {
933
933
PreApply : []plancheck.PlanCheck {
934
934
acctest .ExpectNoDelete (),
@@ -937,6 +937,8 @@ func TestAccContainerNodePool_withKubeletConfig(t *testing.T) {
937
937
Check : resource .ComposeTestCheckFunc (
938
938
resource .TestCheckResourceAttr ("google_container_node_pool.with_kubelet_config" ,
939
939
"node_config.0.kubelet_config.0.cpu_cfs_quota" , "true" ),
940
+ resource .TestCheckResourceAttr ("google_container_node_pool.with_kubelet_config" ,
941
+ "node_config.0.kubelet_config.0.single_process_oom_kill" , "true" ),
940
942
resource .TestCheckResourceAttr ("google_container_node_pool.with_kubelet_config" ,
941
943
"node_config.0.kubelet_config.0.insecure_kubelet_readonly_port_enabled" , "TRUE" ),
942
944
resource .TestCheckResourceAttr ("google_container_node_pool.with_kubelet_config" ,
@@ -963,7 +965,7 @@ func TestAccContainerNodePool_withKubeletConfig(t *testing.T) {
963
965
ImportStateVerify : true ,
964
966
},
965
967
{
966
- Config : testAccContainerNodePool_withKubeletConfig (cluster , np , "" , "" , networkName , subnetworkName , "FALSE" , "200Mi" , "30s" , "" , false , 1024 , 5 , 50 , 80 ),
968
+ Config : testAccContainerNodePool_withKubeletConfig (cluster , np , "" , "" , networkName , subnetworkName , "FALSE" , "200Mi" , "30s" , "" , false , true , 1024 , 5 , 50 , 80 ),
967
969
ConfigPlanChecks : resource.ConfigPlanChecks {
968
970
PreApply : []plancheck.PlanCheck {
969
971
acctest .ExpectNoDelete (),
@@ -1001,7 +1003,7 @@ func TestAccContainerNodePool_withInvalidKubeletCpuManagerPolicy(t *testing.T) {
1001
1003
CheckDestroy : testAccCheckContainerClusterDestroyProducer (t ),
1002
1004
Steps : []resource.TestStep {
1003
1005
{
1004
- Config : testAccContainerNodePool_withKubeletConfig (cluster , np , "dontexist" , "100us" , networkName , subnetworkName , "TRUE" , "" , "" , "" , false , 1024 , 2 , 70 , 75 ),
1006
+ Config : testAccContainerNodePool_withKubeletConfig (cluster , np , "dontexist" , "100us" , networkName , subnetworkName , "TRUE" , "" , "" , "" , false , true , 1024 , 2 , 70 , 75 ),
1005
1007
ExpectError : regexp .MustCompile (`.*to be one of \["?static"? "?none"? "?"?\].*` ),
1006
1008
},
1007
1009
},
@@ -3694,7 +3696,7 @@ resource "google_container_node_pool" "with_workload_metadata_config" {
3694
3696
` , projectID , cluster , networkName , subnetworkName , np )
3695
3697
}
3696
3698
3697
- func testAccContainerNodePool_withKubeletConfig (cluster , np , policy , period , networkName , subnetworkName , insecureKubeletReadonlyPortEnabled , containerLogMaxSize , imageMinimumGcAge , imageMaximumGcAge string , quota bool , podPidsLimit , containerLogMaxFiles , imageGcLowThresholdPercent , imageGcHighThresholdPercent int ) string {
3699
+ func testAccContainerNodePool_withKubeletConfig (cluster , np , policy , period , networkName , subnetworkName , insecureKubeletReadonlyPortEnabled , containerLogMaxSize , imageMinimumGcAge , imageMaximumGcAge string , quota , singleProcessOomKill bool , podPidsLimit , containerLogMaxFiles , imageGcLowThresholdPercent , imageGcHighThresholdPercent int ) string {
3698
3700
return fmt .Sprintf (`
3699
3701
data "google_container_engine_versions" "central1a" {
3700
3702
location = "us-central1-a"
@@ -3732,6 +3734,7 @@ resource "google_container_node_pool" "with_kubelet_config" {
3732
3734
image_minimum_gc_age = %q
3733
3735
image_maximum_gc_age = %q
3734
3736
allowed_unsafe_sysctls = ["kernel.shm*", "kernel.msg*", "kernel.sem", "fs.mqueue.*", "net.*"]
3737
+ single_process_oom_kill = %v
3735
3738
}
3736
3739
oauth_scopes = [
3737
3740
"https://www.googleapis.com/auth/logging.write",
@@ -3740,7 +3743,7 @@ resource "google_container_node_pool" "with_kubelet_config" {
3740
3743
logging_variant = "DEFAULT"
3741
3744
}
3742
3745
}
3743
- ` , cluster , networkName , subnetworkName , np , policy , quota , period , insecureKubeletReadonlyPortEnabled , podPidsLimit , containerLogMaxSize , containerLogMaxFiles , imageGcLowThresholdPercent , imageGcHighThresholdPercent , imageMinimumGcAge , imageMaximumGcAge )
3746
+ ` , cluster , networkName , subnetworkName , np , policy , quota , period , insecureKubeletReadonlyPortEnabled , podPidsLimit , containerLogMaxSize , containerLogMaxFiles , imageGcLowThresholdPercent , imageGcHighThresholdPercent , imageMinimumGcAge , imageMaximumGcAge , singleProcessOomKill )
3744
3747
}
3745
3748
3746
3749
func testAccContainerNodePool_withLinuxNodeConfig (cluster , np , tcpMem , networkName , subnetworkName string ) string {
0 commit comments