Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tencentcloud/resource_tc_kubernetes_cluster_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,20 @@ func TestAccTencentCloudTkeClusterEndpoint(t *testing.T) {
}

const testAccTkeClusterEndpointNewSG = `
resource "tencentcloud_security_group" "foo" {
resource "tencentcloud_security_group" "new_sg" {
name = "test-endpoint"
}

resource "tencentcloud_security_group_lite_rule" "foo" {
security_group_id = tencentcloud_security_group.foo.id
resource "tencentcloud_security_group_lite_rule" "new_sg" {
security_group_id = tencentcloud_security_group.new_sg.id

ingress = [
"DROP#0.0.0.0/16#ALL#ALL",
]
}

locals {
new_sg = tencentcloud_security_group_lite_rule.foo.id
new_sg = tencentcloud_security_group.new_sg.id
}

`
Expand Down
9 changes: 8 additions & 1 deletion tencentcloud/resource_tc_kubernetes_node_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"log"
"regexp"
"strings"
"testing"

Expand All @@ -26,6 +27,8 @@ func init() {
})
}

var nodePoolNameReg = regexp.MustCompile("^(mynodepool|np)")

func testNodePoolSweep(region string) error {
logId := getLogId(contextNil)
ctx := context.WithValue(context.TODO(), logIdKey, logId)
Expand All @@ -50,7 +53,11 @@ func testNodePoolSweep(region string) error {
for i := range nodePools {
poolId := *nodePools[i].NodePoolId
poolName := nodePools[i].Name
if poolName == nil || (*poolName != "mynodepool" && *poolName != "mynodepoolupdate") {
if poolName == nil {
continue
}

if !nodePoolNameReg.MatchString(*poolName) {
continue
}
err := service.DeleteClusterNodePool(ctx, defaultTkeClusterId, poolId, false)
Expand Down