Skip to content

Commit c08d80a

Browse files
committed
update annotations code
1 parent bf98239 commit c08d80a

File tree

3 files changed

+27
-16
lines changed

3 files changed

+27
-16
lines changed

tencentcloud/services/tke/extension_tke.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,10 @@ const (
150150
const (
151151
backupStorageLocationStateAvailable = "Available"
152152
)
153+
154+
// Content automatically added by the backend of cloud products
155+
var tkeNativeNodePoolAnnotationsMap = map[string]string{
156+
"cluster-autoscaler.kubernetes.io/scale-down-disabled": "cluster-autoscaler.kubernetes.io/scale-down-disabled",
157+
"node.tke.cloud.tencent.com/security-agent": "node.tke.cloud.tencent.com/security-agent",
158+
"node.tke.cloud.tencent.com/security-groups-spread": "node.tke.cloud.tencent.com/security-groups-spread",
159+
}

tencentcloud/services/tke/resource_tc_kubernetes_native_node_pool.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tencentcloud/services/tke/resource_tc_kubernetes_native_node_pool_test.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ func TestAccTencentCloudKubernetesNativeNodePoolResource_basic(t *testing.T) {
6767
resource.TestCheckResourceAttr("tencentcloud_kubernetes_native_node_pool.native_node_pool_test", "native.0.data_disks.0.mount_target", "/var/lib/containerd"),
6868
resource.TestCheckResourceAttr("tencentcloud_kubernetes_native_node_pool.native_node_pool_test", "native.0.data_disks.0.auto_format_and_mount", "false"),
6969
resource.TestCheckResourceAttr("tencentcloud_kubernetes_native_node_pool.native_node_pool_test", "native.0.key_ids.#", "1"),
70-
resource.TestCheckResourceAttr("tencentcloud_kubernetes_native_node_pool.native_node_pool_test", "annotations.#", "1"),
71-
resource.TestCheckResourceAttrSet("tencentcloud_kubernetes_native_node_pool.native_node_pool_test", "annotations.0.name"),
72-
resource.TestCheckResourceAttrSet("tencentcloud_kubernetes_native_node_pool.native_node_pool_test", "annotations.0.value"),
70+
resource.TestCheckResourceAttr("tencentcloud_kubernetes_native_node_pool.native_node_pool_test", "annotations.#", "0"),
71+
//resource.TestCheckResourceAttrSet("tencentcloud_kubernetes_native_node_pool.native_node_pool_test", "annotations.0.name"),
72+
//resource.TestCheckResourceAttrSet("tencentcloud_kubernetes_native_node_pool.native_node_pool_test", "annotations.0.value"),
7373
),
7474
},
7575
{
@@ -107,7 +107,7 @@ func TestAccTencentCloudKubernetesNativeNodePoolResource_basic(t *testing.T) {
107107
resource.TestCheckResourceAttr("tencentcloud_kubernetes_native_node_pool.native_node_pool_test", "native.0.data_disks.0.disk_size", "60"),
108108
resource.TestCheckResourceAttr("tencentcloud_kubernetes_native_node_pool.native_node_pool_test", "native.0.data_disks.0.auto_format_and_mount", "true"),
109109
resource.TestCheckResourceAttr("tencentcloud_kubernetes_native_node_pool.native_node_pool_test", "native.0.key_ids.#", "2"),
110-
resource.TestCheckResourceAttr("tencentcloud_kubernetes_native_node_pool.native_node_pool_test", "annotations.#", "2"),
110+
resource.TestCheckResourceAttr("tencentcloud_kubernetes_native_node_pool.native_node_pool_test", "annotations.#", "0"),
111111
),
112112
},
113113
{
@@ -299,10 +299,10 @@ resource "tencentcloud_kubernetes_native_node_pool" "native_node_pool_test" {
299299
key_ids = [tencentcloud_key_pair.key_pair1.id]
300300
}
301301
302-
annotations {
303-
name = "cluster-autoscaler.kubernetes.io/scale-down-disabled"
304-
value = "true"
305-
}
302+
//annotations {
303+
// name = "cluster-autoscaler.kubernetes.io/scale-down-disabled"
304+
// value = "true"
305+
//}
306306
}
307307
`
308308

@@ -386,13 +386,13 @@ resource "tencentcloud_kubernetes_native_node_pool" "native_node_pool_test" {
386386
key_ids = [local.ssh1, local.ssh2]
387387
}
388388
389-
annotations {
390-
name = "cluster-autoscaler.kubernetes.io/scale-down-disabled"
391-
value = "true"
392-
}
393-
annotations {
394-
name = "node.tke.cloud.tencent.com/security-agent"
395-
value = "false"
396-
}
389+
//annotations {
390+
// name = "cluster-autoscaler.kubernetes.io/scale-down-disabled"
391+
// value = "true"
392+
//}
393+
//annotations {
394+
// name = "node.tke.cloud.tencent.com/security-agent"
395+
// value = "false"
396+
//}
397397
}
398398
`

0 commit comments

Comments
 (0)