Skip to content

Commit 58b5477

Browse files
authored
fix: remove pod and service num validate (#874)
1 parent 693598f commit 58b5477

File tree

2 files changed

+4
-24
lines changed

2 files changed

+4
-24
lines changed

tencentcloud/resource_tc_kubernetes_cluster.go

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,34 +1076,14 @@ func resourceTencentCloudTkeCluster() *schema.Resource {
10761076
ForceNew: true,
10771077
Optional: true,
10781078
Default: 256,
1079-
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
1080-
value := v.(int)
1081-
if value%16 != 0 {
1082-
errors = append(errors, fmt.Errorf(
1083-
"%q has to be a multiple of 16 ", k))
1084-
}
1085-
if value < 32 {
1086-
errors = append(errors, fmt.Errorf(
1087-
"%q cannot be lower than %d: %d", k, 32, value))
1088-
}
1089-
return
1090-
},
1091-
Description: "The maximum number of Pods per node in the cluster. Default is 256. Must be a multiple of 16 and large than 32.",
1079+
Description: "The maximum number of Pods per node in the cluster. Default is 256. The minimum value is 4. When its power unequal to 2, it will round upward to the closest power of 2.",
10921080
},
10931081
"cluster_max_service_num": {
10941082
Type: schema.TypeInt,
10951083
ForceNew: true,
10961084
Optional: true,
10971085
Default: 256,
1098-
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
1099-
value := v.(int)
1100-
if value%16 != 0 {
1101-
errors = append(errors, fmt.Errorf(
1102-
"%q has to be a multiple of 16 ", k))
1103-
}
1104-
return
1105-
},
1106-
Description: "The maximum number of services in the cluster. Default is 256. Must be a multiple of 16.",
1086+
Description: "The maximum number of services in the cluster. Default is 256. The range is from 32 to 32768. When its power unequal to 2, it will round upward to the closest power of 2.",
11071087
},
11081088
"service_cidr": {
11091089
Type: schema.TypeString,

website/docs/r/kubernetes_cluster.html.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,8 @@ The following arguments are supported:
423423
* `cluster_intranet_subnet_id` - (Optional) Subnet id who can access this independent cluster, this field must and can only set when `cluster_intranet` is true. `cluster_intranet_subnet_id` can not modify once be set.
424424
* `cluster_intranet` - (Optional) Open intranet access or not.
425425
* `cluster_ipvs` - (Optional, ForceNew) Indicates whether `ipvs` is enabled. Default is true. False means `iptables` is enabled.
426-
* `cluster_max_pod_num` - (Optional, ForceNew) The maximum number of Pods per node in the cluster. Default is 256. Must be a multiple of 16 and large than 32.
427-
* `cluster_max_service_num` - (Optional, ForceNew) The maximum number of services in the cluster. Default is 256. Must be a multiple of 16.
426+
* `cluster_max_pod_num` - (Optional, ForceNew) The maximum number of Pods per node in the cluster. Default is 256. The minimum value is 4. When its power unequal to 2, it will round upward to the closest power of 2.
427+
* `cluster_max_service_num` - (Optional, ForceNew) The maximum number of services in the cluster. Default is 256. The range is from 32 to 32768. When its power unequal to 2, it will round upward to the closest power of 2.
428428
* `cluster_name` - (Optional) Name of the cluster.
429429
* `cluster_os_type` - (Optional, ForceNew) Image type of the cluster os, the available values include: 'GENERAL'. Default is 'GENERAL'.
430430
* `cluster_os` - (Optional, ForceNew) Operating system of the cluster, the available values include: 'centos7.6.0_x64','ubuntu18.04.1x86_64','tlinux2.4x86_64'. Default is 'tlinux2.4x86_64'.

0 commit comments

Comments
 (0)