Skip to content

Commit 8ddbdbc

Browse files
committed
fix(tke):[118694498]fix unschedulable cannot work.
1 parent 2837924 commit 8ddbdbc

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

tencentcloud/services/tke/resource_tc_kubernetes_cluster_attachment.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ func ResourceTencentCloudKubernetesClusterAttachment() *schema.Resource {
170170
Optional: true,
171171
ForceNew: true,
172172
Default: true,
173+
Deprecated: "This argument was deprecated, use `unschedulable` instead.",
173174
Description: "Indicate to schedule the adding node or not. Default is true.",
174175
},
175176
"desired_pod_num": {
@@ -234,13 +235,15 @@ func ResourceTencentCloudKubernetesClusterAttachment() *schema.Resource {
234235
Type: schema.TypeString,
235236
Optional: true,
236237
ForceNew: true,
238+
Deprecated: "This argument was no longer supported by TencentCloud TKE.",
237239
Description: "Mount target. Default is not mounting.",
238240
},
239241
"docker_graph_path": {
240242
Type: schema.TypeString,
241243
Optional: true,
242244
ForceNew: true,
243245
Default: "/var/lib/docker",
246+
Deprecated: "This argument was no longer supported by TencentCloud TKE.",
244247
Description: "Docker graph path. Default is `/var/lib/docker`.",
245248
},
246249
"data_disk": {
@@ -300,6 +303,7 @@ func ResourceTencentCloudKubernetesClusterAttachment() *schema.Resource {
300303
Type: schema.TypeList,
301304
Optional: true,
302305
ForceNew: true,
306+
Deprecated: "This argument was no longer supported by TencentCloud TKE.",
303307
Description: "Custom parameter information related to the node. This is a white-list parameter.",
304308
Elem: &schema.Schema{
305309
Type: schema.TypeString,
@@ -309,19 +313,22 @@ func ResourceTencentCloudKubernetesClusterAttachment() *schema.Resource {
309313
Type: schema.TypeString,
310314
Optional: true,
311315
ForceNew: true,
316+
Deprecated: "This argument was no longer supported by TencentCloud TKE.",
312317
Description: "Base64-encoded User Data text, the length limit is 16KB.",
313318
},
314319
"pre_start_user_script": {
315320
Type: schema.TypeString,
316321
Optional: true,
317322
ForceNew: true,
323+
Deprecated: "This argument was no longer supported by TencentCloud TKE.",
318324
Description: "Base64-encoded user script, executed before initializing the node, currently only effective for adding existing nodes.",
319325
},
320326
"is_schedule": {
321327
Type: schema.TypeBool,
322328
Optional: true,
323329
ForceNew: true,
324330
Default: true,
331+
Deprecated: "This argument was deprecated, use `unschedulable` instead.",
325332
Description: "Indicate to schedule the adding node or not. Default is true.",
326333
},
327334
"desired_pod_num": {
@@ -386,7 +393,7 @@ func ResourceTencentCloudKubernetesClusterAttachment() *schema.Resource {
386393
Optional: true,
387394
ForceNew: true,
388395
Default: 0,
389-
Description: "Sets whether the joining node participates in the schedule. Default is '0'. Participate in scheduling.",
396+
Description: "Sets whether the joining node participates in the schedule. Default is `0`, which means it participates in scheduling. Non-zero(eg: `1`) number means it does not participate in scheduling.",
390397
},
391398

392399
"security_groups": {
@@ -496,9 +503,6 @@ func resourceTencentCloudKubernetesClusterAttachmentCreate(d *schema.ResourceDat
496503
}
497504
instanceAdvancedSettings.GPUArgs = &gPUArgs
498505
}
499-
if v, ok := d.GetOkExists("unschedulable"); ok {
500-
instanceAdvancedSettings.Unschedulable = helper.IntInt64(v.(int))
501-
}
502506
request.InstanceAdvancedSettings = &instanceAdvancedSettings
503507
}
504508

@@ -557,9 +561,6 @@ func resourceTencentCloudKubernetesClusterAttachmentCreate(d *schema.ResourceDat
557561
}
558562
instanceAdvancedSettings.GPUArgs = &gPUArgs2
559563
}
560-
if v, ok := d.GetOkExists("unschedulable"); ok {
561-
instanceAdvancedSettings.Unschedulable = helper.IntInt64(v.(int))
562-
}
563564
request.InstanceAdvancedSettingsOverrides = append(request.InstanceAdvancedSettingsOverrides, &instanceAdvancedSettings)
564565
}
565566
}

tencentcloud/services/tke/resource_tc_kubernetes_cluster_attachment_extension.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,18 @@ func resourceTencentCloudKubernetesClusterAttachmentCreatePostFillRequest0(ctx c
4141
return fmt.Errorf("parameters `key_ids` and `password` must set and only set one")
4242
}
4343

44+
if req.InstanceAdvancedSettings == nil {
45+
req.InstanceAdvancedSettings = &tke.InstanceAdvancedSettings{}
46+
}
4447
// labels
4548
req.InstanceAdvancedSettings = &tke.InstanceAdvancedSettings{}
4649
req.InstanceAdvancedSettings.Labels = GetTkeLabels(d, "labels")
4750

51+
// only this unschedulable is valid, the is_schedule of worker_config and worker_config_overrides was deprecated.
52+
if v, ok := d.GetOkExists("unschedulable"); ok {
53+
req.InstanceAdvancedSettings.Unschedulable = helper.IntInt64(v.(int))
54+
}
55+
4856
if dMap, ok := helper.InterfacesHeadMap(d, "worker_config"); ok {
4957
completeInstanceAdvancedSettings(dMap, req.InstanceAdvancedSettings)
5058
}

0 commit comments

Comments
 (0)