Skip to content

Commit 2c5e200

Browse files
committed
Merge remote-tracking branch 'upstream/master' into feature/ssm
2 parents 30faf60 + b5694a4 commit 2c5e200

25 files changed

+403
-14
lines changed

CHANGELOG.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
## 1.54.0 (Unreleased)
1+
## 1.54.2 (Unreleased)
2+
## 1.54.1 (March 24, 2021)
3+
4+
ENHANCEMENTS:
5+
6+
* Resource `tencentcloud_tcr_vpc_attachment` add `enable_public_domain_dns`, `enable_vpc_domain_dns` to set whether to enable dns.
7+
* Data Source `tencentcloud_tcr_vpc_attachments` add `enable_public_domain_dns`, `enable_vpc_domain_dns`.
8+
9+
## 1.54.0 (March 22, 2021)
210

311
FEATURES:
412

@@ -10,6 +18,13 @@ FEATURES:
1018
* **New Data Source**: `tencentcloud_ssm_secrets`
1119
* **New Data Source**: `tencentcloud_ssm_secret_versions`
1220

21+
ENHANCEMENTS:
22+
23+
* Resource `tencentcloud_kubernetes_cluster_attachment` add `unschedulable` to sets whether the joining node participates in the schedule.
24+
* Resource `tencentcloud_kubernetes_cluster` add `unschedulable` to sets whether the joining node participates in the schedule.
25+
* Resource `tencentcloud_kubernetes_node_pool` add `unschedulable` to sets whether the joining node participates in the schedule.
26+
* Resource `tencentcloud_kubernetes_scale_worker` add `unschedulable` to sets whether the joining node participates in the schedule.
27+
1328
## 1.53.9 (March 19, 2021)
1429

1530
ENHANCEMENTS:

tencentcloud/connectivity/transport.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"time"
1111
)
1212

13-
const ReqClient = "Terraform-v1.53.9"
13+
const ReqClient = "Terraform-v1.54.1"
1414

1515
type LogRoundTripper struct {
1616
}

tencentcloud/data_source_tc_tcr_vpc_attachments.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,16 @@ func dataSourceTencentCloudTCRVPCAttachments() *schema.Resource {
7272
Computed: true,
7373
Description: "IP address of this VPC access.",
7474
},
75+
"enable_public_domain_dns": {
76+
Type: schema.TypeBool,
77+
Computed: true,
78+
Description: "Whether to enable public domain dns.",
79+
},
80+
"enable_vpc_domain_dns": {
81+
Type: schema.TypeBool,
82+
Computed: true,
83+
Description: "Whether to enable vpc domain dns.",
84+
},
7585
},
7686
},
7787
},
@@ -120,6 +130,19 @@ func dataSourceTencentCloudTCRVPCAttachmentsRead(d *schema.ResourceData, meta in
120130
"status": vpcAccess.Status,
121131
"access_ip": vpcAccess.AccessIp,
122132
}
133+
if *vpcAccess.AccessIp != "" {
134+
publicDomainDnsStatus, err := GetDnsStatus(ctx, tcrService, instanceId, *vpcAccess.VpcId, *vpcAccess.AccessIp, true)
135+
if err != nil {
136+
return err
137+
}
138+
mapping["enable_public_domain_dns"] = *publicDomainDnsStatus.Status == TCR_VPC_DNS_STATUS_ENABLED
139+
140+
vpcDomainDnsStatus, err := GetDnsStatus(ctx, tcrService, instanceId, *vpcAccess.VpcId, *vpcAccess.AccessIp, false)
141+
if err != nil {
142+
return err
143+
}
144+
mapping["enable_vpc_domain_dns"] = *vpcDomainDnsStatus.Status == TCR_VPC_DNS_STATUS_ENABLED
145+
}
123146

124147
vpcAccessList = append(vpcAccessList, mapping)
125148
ids = append(ids, instanceId+FILED_SP+*vpcAccess.VpcId+FILED_SP+*vpcAccess.SubnetId)

tencentcloud/extension_tcr.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package tencentcloud
2+
3+
const (
4+
TCR_VPC_DNS_STATUS_ENABLED = "ENABLED"
5+
TCR_VPC_DNS_STATUS_DISABLED = "DISABLED"
6+
)

tencentcloud/resource_tc_kubernetes_as_scaling_group.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,13 @@ func ResourceTencentCloudKubernetesAsScalingGroup() *schema.Resource {
186186
Elem: &schema.Schema{Type: schema.TypeString},
187187
Description: "Custom parameter information related to the node.",
188188
},
189+
"unschedulable": {
190+
Type: schema.TypeInt,
191+
Optional: true,
192+
ForceNew: true,
193+
Default: 0,
194+
Description: "Sets whether the joining node participates in the schedule. Default is '0'. Participate in scheduling.",
195+
},
189196
},
190197
}
191198
}
@@ -844,7 +851,9 @@ func resourceKubernetesAsScalingGroupCreate(d *schema.ResourceData, meta interfa
844851
}
845852

846853
labels := GetTkeLabels(d, "labels")
847-
854+
if temp, ok := d.GetOk("unschedulable"); ok {
855+
iAdvanced.Unschedulable = int64(temp.(int))
856+
}
848857
if temp, ok := d.GetOk("extra_args"); ok {
849858
extraArgs := helper.InterfacesStrings(temp.([]interface{}))
850859
for _, extraArg := range extraArgs {

tencentcloud/resource_tc_kubernetes_as_scaling_group_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ resource "tencentcloud_kubernetes_as_scaling_group" "as_test" {
212212
}
213213
214214
}
215-
215+
unschedulable = 0
216216
labels = {
217217
"test1" = "test1",
218218
"test2" = "test2",
@@ -271,7 +271,7 @@ resource "tencentcloud_kubernetes_as_scaling_group" "as_test" {
271271
}
272272
273273
}
274-
274+
unschedulable = 1
275275
labels = {
276276
"test1" = "test1",
277277
"test2" = "test2",

tencentcloud/resource_tc_kubernetes_cluster.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,13 @@ func resourceTencentCloudTkeCluster() *schema.Resource {
830830
ForceNew: true,
831831
Description: "Labels of tke cluster nodes.",
832832
},
833+
"unschedulable": {
834+
Type: schema.TypeInt,
835+
Optional: true,
836+
ForceNew: true,
837+
Default: 0,
838+
Description: "Sets whether the joining node participates in the schedule. Default is '0'. Participate in scheduling.",
839+
},
833840
"mount_target": {
834841
Type: schema.TypeString,
835842
Optional: true,
@@ -1290,7 +1297,9 @@ func resourceTencentCloudTkeClusterCreate(d *schema.ResourceData, meta interface
12901297
iAdvanced.ExtraArgs.Kubelet = append(iAdvanced.ExtraArgs.Kubelet, &extraArgs[i])
12911298
}
12921299
}
1293-
1300+
if temp, ok := d.GetOk("unschedulable"); ok {
1301+
iAdvanced.Unschedulable = int64(temp.(int))
1302+
}
12941303
if temp, ok := d.GetOk("docker_graph_path"); ok {
12951304
iAdvanced.DockerGraphPath = temp.(string)
12961305
}

tencentcloud/resource_tc_kubernetes_cluster_attachment.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,13 @@ func resourceTencentCloudTkeClusterAttachment() *schema.Resource {
248248
ForceNew: true,
249249
Description: "Labels of tke attachment exits CVM.",
250250
},
251+
"unschedulable": {
252+
Type: schema.TypeInt,
253+
Optional: true,
254+
ForceNew: true,
255+
Default: 0,
256+
Description: "Sets whether the joining node participates in the schedule. Default is '0'. Participate in scheduling.",
257+
},
251258
//compute
252259
"security_groups": {
253260
Type: schema.TypeSet,
@@ -399,6 +406,7 @@ func resourceTencentCloudTkeClusterAttachmentRead(d *schema.ResourceData, meta i
399406
return resource.RetryableError(fmt.Errorf("cvm instance %s in tke status is %s, retry...",
400407
worker.InstanceId, worker.InstanceState))
401408
}
409+
_ = d.Set("unschedulable", worker.InstanceAdvancedSettings.Unschedulable)
402410
}
403411
}
404412

@@ -471,6 +479,10 @@ func resourceTencentCloudTkeClusterAttachmentCreate(d *schema.ResourceData, meta
471479
request.HostName = &hostNameStr
472480
}
473481

482+
if v, ok := d.GetOk("unschedulable"); ok {
483+
request.InstanceAdvancedSettings.Unschedulable = helper.Int64(v.(int64))
484+
}
485+
474486
/*cvm has been attached*/
475487
var err error
476488
_, workers, err := tkeService.DescribeClusterInstances(ctx, *request.ClusterId)

tencentcloud/resource_tc_kubernetes_cluster_attachment_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ func TestAccTencentCloudTkeAttachResource(t *testing.T) {
2222
testAccCheckTkeAttachExists("tencentcloud_kubernetes_cluster_attachment.test_attach"),
2323
resource.TestCheckResourceAttrSet("tencentcloud_kubernetes_cluster_attachment.test_attach", "cluster_id"),
2424
resource.TestCheckResourceAttrSet("tencentcloud_kubernetes_cluster_attachment.test_attach", "instance_id"),
25+
resource.TestCheckResourceAttrSet("tencentcloud_kubernetes_cluster_attachment.test_attach", "unschedulable"),
2526
resource.TestCheckResourceAttr("tencentcloud_kubernetes_cluster_attachment.test_attach", "labels.test1", "test1"),
2627
resource.TestCheckResourceAttr("tencentcloud_kubernetes_cluster_attachment.test_attach", "labels.test2", "test2"),
2728
),
@@ -209,15 +210,13 @@ resource "tencentcloud_kubernetes_cluster_attachment" "test_attach" {
209210
cluster_id = tencentcloud_kubernetes_cluster.managed_cluster.id
210211
instance_id = tencentcloud_instance.foo.id
211212
password = "Lo4wbdit"
213+
unschedulable = 0
212214
213215
labels = {
214216
"test1" = "test1",
215217
"test2" = "test2",
216218
}
217219
218-
extra_args = [
219-
"root-dir=/var/lib/kubelet"
220-
]
221220
}
222221
`
223222
}

tencentcloud/resource_tc_kubernetes_cluster_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ func TestAccTencentCloudTkeResource(t *testing.T) {
3838
resource.TestCheckResourceAttrSet(testTkeClusterResourceKey, "cluster_external_endpoint"),
3939
resource.TestCheckResourceAttr(testTkeClusterResourceKey, "labels.test1", "test1"),
4040
resource.TestCheckResourceAttr(testTkeClusterResourceKey, "labels.test2", "test2"),
41+
resource.TestCheckResourceAttr(testTkeClusterResourceKey, "unschedulable", "0"),
4142
),
4243
},
4344
{
@@ -191,6 +192,8 @@ resource "tencentcloud_kubernetes_cluster" "managed_cluster" {
191192
"%s" = "%s"
192193
}
193194
195+
unschedulable = 0
196+
194197
labels = {
195198
"test1" = "test1",
196199
"test2" = "test2",

0 commit comments

Comments
 (0)