Skip to content

Commit 67c6519

Browse files
authored
fix: nodepool cam role test case (#900)
1 parent ab1f812 commit 67c6519

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

tencentcloud/resource_tc_kubernetes_node_pool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ func composedKubernetesAsScalingConfigParaSerial(dMap map[string]interface{}, me
746746
request.InstanceChargeType = &chargeType
747747

748748
if v, ok := dMap["cam_role_name"]; ok {
749-
request.CamRoleName = helper.String(v.(string))
749+
request.CamRoleName = helper.String(v.(string))
750750
}
751751
result = request.ToJsonString()
752752
return result, errRet

tencentcloud/resource_tc_kubernetes_node_pool_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ func TestAccTencentCloudTkeNodePoolResource(t *testing.T) {
3030
resource.TestCheckResourceAttr(testTkeClusterNodePoolResourceKey, "auto_scaling_config.0.system_disk_size", "50"),
3131
resource.TestCheckResourceAttr(testTkeClusterNodePoolResourceKey, "auto_scaling_config.0.data_disk.#", "1"),
3232
resource.TestCheckResourceAttr(testTkeClusterNodePoolResourceKey, "auto_scaling_config.0.internet_max_bandwidth_out", "10"),
33+
resource.TestCheckResourceAttr(testTkeClusterNodePoolResourceKey, "auto_scaling_config.0.cam_role_name", "TCB_QcsRole"),
3334
resource.TestCheckResourceAttr(testTkeClusterNodePoolResourceKey, "taints.#", "1"),
3435
resource.TestCheckResourceAttr(testTkeClusterNodePoolResourceKey, "labels.test1", "test1"),
3536
resource.TestCheckResourceAttr(testTkeClusterNodePoolResourceKey, "labels.test2", "test2"),
@@ -57,6 +58,7 @@ func TestAccTencentCloudTkeNodePoolResource(t *testing.T) {
5758
resource.TestCheckResourceAttr(testTkeClusterNodePoolResourceKey, "auto_scaling_config.0.instance_charge_type", "SPOTPAID"),
5859
resource.TestCheckResourceAttr(testTkeClusterNodePoolResourceKey, "auto_scaling_config.0.spot_instance_type", "one-time"),
5960
resource.TestCheckResourceAttr(testTkeClusterNodePoolResourceKey, "auto_scaling_config.0.spot_max_price", "1000"),
61+
resource.TestCheckResourceAttr(testTkeClusterNodePoolResourceKey, "auto_scaling_config.0.cam_role_name", "TCB_QcsRole"),
6062
resource.TestCheckResourceAttr(testTkeClusterNodePoolResourceKey, "max_size", "5"),
6163
resource.TestCheckResourceAttr(testTkeClusterNodePoolResourceKey, "min_size", "2"),
6264
resource.TestCheckResourceAttr(testTkeClusterNodePoolResourceKey, "labels.test3", "test3"),
@@ -150,7 +152,7 @@ variable "availability_zone" {
150152
}
151153
152154
variable "cluster_cidr" {
153-
default = "172.31.0.0/16"
155+
default = "192.168.0.0/16"
154156
}
155157
156158
data "tencentcloud_vpc_subnets" "vpc" {
@@ -222,6 +224,7 @@ resource "tencentcloud_kubernetes_node_pool" "np_test" {
222224
system_disk_size = "50"
223225
security_group_ids = [data.tencentcloud_security_groups.sg.security_groups[0].security_group_id]
224226
227+
cam_role_name = "TCB_QcsRole"
225228
data_disk {
226229
disk_type = "CLOUD_PREMIUM"
227230
disk_size = 50
@@ -281,6 +284,8 @@ resource "tencentcloud_kubernetes_node_pool" "np_test" {
281284
spot_instance_type = "one-time"
282285
spot_max_price = "1000"
283286
287+
cam_role_name = "TCB_QcsRole"
288+
284289
data_disk {
285290
disk_type = "CLOUD_PREMIUM"
286291
disk_size = 50

tencentcloud/resource_tc_vpn_ssl_client.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ package tencentcloud
2424
import (
2525
"context"
2626
"fmt"
27+
"log"
28+
"time"
29+
2730
vpc "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312"
2831
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper"
2932
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/ratelimit"
30-
"log"
31-
"time"
3233

3334
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
3435
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
@@ -67,8 +68,8 @@ func resourceTencentCloudVpnSslClientCreate(d *schema.ResourceData, meta interfa
6768
ctx := context.WithValue(context.TODO(), logIdKey, logId)
6869

6970
var (
70-
vpcService = VpcService{client: meta.(*TencentCloudClient).apiV3Conn}
71-
request = vpc.NewCreateVpnGatewaySslClientRequest()
71+
vpcService = VpcService{client: meta.(*TencentCloudClient).apiV3Conn}
72+
request = vpc.NewCreateVpnGatewaySslClientRequest()
7273
sslVpnServerId string
7374
)
7475

tencentcloud/resource_tc_vpn_ssl_server.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ package tencentcloud
3232
import (
3333
"context"
3434
"fmt"
35+
"log"
36+
"time"
37+
3538
vpc "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312"
3639
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper"
3740
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/ratelimit"
38-
"log"
39-
"time"
4041

4142
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
4243
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
@@ -99,9 +100,9 @@ func resourceTencentCloudVpnSslServer() *schema.Resource {
99100
Description: "The integrity algorithm. Valid values: SHA1, MD5 and NONE. Default value: NONE.",
100101
},
101102
"encrypt_algorithm": {
102-
Type: schema.TypeString,
103-
Optional: true,
104-
ForceNew: true,
103+
Type: schema.TypeString,
104+
Optional: true,
105+
ForceNew: true,
105106
Description: "The encrypt algorithm. Valid values: AES-128-CBC, AES-192-CBC, AES-256-CBC, NONE." +
106107
"Default value: NONE.",
107108
},

0 commit comments

Comments
 (0)