@@ -527,10 +527,12 @@ func TestAccContainerNodePool_withKubeletConfig(t *testing.T) {
527
527
CheckDestroy: testAccCheckContainerClusterDestroyProducer(t),
528
528
Steps: []resource.TestStep{
529
529
{
530
- Config: testAccContainerNodePool_withKubeletConfig(cluster, np, "static", "100ms", networkName, subnetworkName, true, 2048),
530
+ Config: testAccContainerNodePool_withKubeletConfig(cluster, np, "static", "100ms", networkName, subnetworkName, true, false, 2048),
531
531
Check: resource.ComposeTestCheckFunc(
532
532
resource.TestCheckResourceAttr("google_container_node_pool.with_kubelet_config",
533
533
"node_config.0.kubelet_config.0.cpu_cfs_quota", "true"),
534
+ resource.TestCheckResourceAttr("google_container_node_pool.with_kubelet_config",
535
+ "node_config.0.kubelet_config.0.insecure_kubelet_readonly_port_enabled", "false"),
534
536
resource.TestCheckResourceAttr("google_container_node_pool.with_kubelet_config",
535
537
"node_config.0.kubelet_config.0.pod_pids_limit", "2048"),
536
538
),
@@ -541,10 +543,12 @@ func TestAccContainerNodePool_withKubeletConfig(t *testing.T) {
541
543
ImportStateVerify: true,
542
544
},
543
545
{
544
- Config: testAccContainerNodePool_withKubeletConfig(cluster, np, "", "", networkName, subnetworkName, false, 1024),
546
+ Config: testAccContainerNodePool_withKubeletConfig(cluster, np, "", "", networkName, subnetworkName, false, true, 1024),
545
547
Check: resource.ComposeTestCheckFunc(
546
548
resource.TestCheckResourceAttr("google_container_node_pool.with_kubelet_config",
547
549
"node_config.0.kubelet_config.0.cpu_cfs_quota", "false"),
550
+ resource.TestCheckResourceAttr("google_container_node_pool.with_kubelet_config",
551
+ "node_config.0.kubelet_config.0.insecure_kubelet_readonly_port_enabled", "true"),
548
552
),
549
553
},
550
554
{
@@ -3137,7 +3141,7 @@ resource "google_container_node_pool" "with_sandbox_config" {
3137
3141
}
3138
3142
<% end -%>
3139
3143
3140
- func testAccContainerNodePool_withKubeletConfig(cluster, np, policy, period, networkName, subnetworkName string, quota bool, podPidsLimit int) string {
3144
+ func testAccContainerNodePool_withKubeletConfig(cluster, np, policy, period, networkName, subnetworkName string, quota bool, insecureKubeletReadonlyPortEnabled bool, podPidsLimit int) string {
3141
3145
return fmt.Sprintf(`
3142
3146
data "google_container_engine_versions" "central1a" {
3143
3147
location = "us-central1-a"
@@ -3163,10 +3167,11 @@ resource "google_container_node_pool" "with_kubelet_config" {
3163
3167
node_config {
3164
3168
image_type = "COS_CONTAINERD"
3165
3169
kubelet_config {
3166
- cpu_manager_policy = %q
3167
- cpu_cfs_quota = %v
3168
- cpu_cfs_quota_period = %q
3169
- pod_pids_limit = %d
3170
+ cpu_manager_policy = %q
3171
+ cpu_cfs_quota = %v
3172
+ cpu_cfs_quota_period = %q
3173
+ insecure_kubelet_readonly_port_enabled = %v
3174
+ pod_pids_limit = %d
3170
3175
}
3171
3176
oauth_scopes = [
3172
3177
"https://www.googleapis.com/auth/logging.write",
@@ -4929,4 +4934,4 @@ resource "google_container_node_pool" "np" {
4929
4934
}
4930
4935
}
4931
4936
`, cluster, np)
4932
- }
4937
+ }
0 commit comments