-
Notifications
You must be signed in to change notification settings - Fork 141
add tcp/udp listener target group attachment #550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -1219,7 +1220,7 @@ func (me *ClbService) DescribeAssociateTargetGroups(ctx context.Context, ids []s | |||
originLocationId = *rule.LocationId | |||
} | |||
|
|||
if originListenerId == ids[1] && originClbId == ids[2] && originLocationId == ids[3] { | |||
if originListenerId == ids[1] && originClbId == ids[2] || originLocationId == ids[3] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个逻辑关系不对
@@ -265,7 +260,7 @@ func resourceTencentCloudClbTargetGroupAttachmentDelete(d *schema.ResourceData, | |||
originLocationId = *rule.LocationId | |||
} | |||
|
|||
if originListenerId == ids[1] && originClbId == ids[2] && originLocationId == ids[3] { | |||
if originListenerId == ids[1] && originClbId == ids[2] || originLocationId == ids[3] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
逻辑关系不对
@@ -219,10 +211,12 @@ func resourceTencentCloudClbTargetGroupAttachmentRead(d *schema.ResourceData, me | |||
return nil | |||
} | |||
|
|||
_ = d.Set("targrt_group_id", ids[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
直接去掉这个的赋值会不会引起forceNew?用旧版本下的tf到新版本apply试一下
targetGroupId = vTarget.(string) | ||
} | ||
} else { | ||
return fmt.Errorf("'target_group_id' or 'targrt_group_id' at least one") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at least set one, 不过这里如果报错 推荐客户直接使用这个target_group_id. 报错考虑一下用户体验
defer logElapsed("resource.tencentcloud_clb_redirection.update")() | ||
defer inconsistentCheck(d, meta)() | ||
// this nil update method works for the only filed `delete_all_auto_rewrite` | ||
return resourceTencentCloudClbRedirectionRead(d, meta) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
怎么全部copy过来了?
} | ||
|
||
if err := clbService.DisassociateTargetGroups(ctx, ids[0], ids[1], ids[2], ids[3]); err != nil { | ||
return err | ||
} | ||
time.Sleep(10 * time.Second) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
下面已经有这个describe来等待状态,这里还要加sleep的原因是?
@@ -11,6 +11,8 @@ description: |- | |||
|
|||
Provides a resource to create a CLB target group attachment is bound to the load balancing listener or forwarding rule. | |||
|
|||
~> **NOTE:** Required argument `targrt_group_id` is no longer supported, replace by `target_group_id`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个写在changelog里就可以了
|
||
targetInfos []*clb.TargetGroupInfo | ||
instance *clb.LoadBalancer | ||
//listener *clb.Listener |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
去掉注释
@@ -207,7 +210,7 @@ func resourceTencentCloudClbTargetGroupAttachmentRead(d *schema.ResourceData, me | |||
|
|||
ids := strings.Split(id, FILED_SP) | |||
if len(ids) != 4 { | |||
return fmt.Errorf("CLB target group attachment id must contains clb_id, listernrt_id, targrt_group_id, rule_id") | |||
return fmt.Errorf("CLB target group attachment id must contains clb_id, listernrt_id, target_group_id, rule_id") | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
报错还是有点问题 现在增加了四层的选项 不该强制rule_id。 clb_id#listener_id#target_group_id#rule_id(optional for 7 layer) 再检查一下拼写错误
make testacc TESTARGS="-run TestAccTencentClbTargetGroupAttachmentHttpResource"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -run TestAccTencentClbTargetGroupAttachmentHttpResource -timeout 120m
? github.com/tencentcloudstack/terraform-provider-tencentcloud [no test files]
testing: warning: no tests to run
PASS
ok github.com/tencentcloudstack/terraform-provider-tencentcloud/gendoc (cached) [no tests to run]
=== RUN TestAccTencentClbTargetGroupAttachmentHttpResource
--- PASS: TestAccTencentClbTargetGroupAttachmentHttpResource (45.21s)
PASS
ok github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud 46.752s
? github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/connectivity [no test files]
? github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper [no test files]
? github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/ratelimit [no test files]
make testacc TESTARGS="-run TestAccTencentClbTargetGroupAttachmentResource"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -run TestAccTencentClbTargetGroupAttachmentResource -timeout 120m
? github.com/tencentcloudstack/terraform-provider-tencentcloud [no test files]
testing: warning: no tests to run
PASS
ok github.com/tencentcloudstack/terraform-provider-tencentcloud/gendoc (cached) [no tests to run]
=== RUN TestAccTencentClbTargetGroupAttachmentResource
--- PASS: TestAccTencentClbTargetGroupAttachmentResource (33.69s)
PASS
ok github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud 35.500s
? github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/connectivity [no test files]
? github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper [no test files]
? github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/ratelimit [no test files]