@@ -1264,6 +1264,10 @@ func (me *ClbService) DescribeTargetGroupInstances(ctx context.Context, filters
1264
1264
}
1265
1265
1266
1266
func (me * ClbService ) AssociateTargetGroups (ctx context.Context , listenerId , clbId , targetGroupId , locationId string ) (errRet error ) {
1267
+
1268
+ var (
1269
+ logId = getLogId (ctx )
1270
+ )
1267
1271
request := clb .NewAssociateTargetGroupsRequest ()
1268
1272
association := clb.TargetGroupAssociation {
1269
1273
LoadBalancerId : & clbId ,
@@ -1277,9 +1281,17 @@ func (me *ClbService) AssociateTargetGroups(ctx context.Context, listenerId, clb
1277
1281
1278
1282
err := resource .Retry (writeRetryTimeout , func () * resource.RetryError {
1279
1283
ratelimit .Check (request .GetAction ())
1280
- _ , err := me .client .UseClbClient ().AssociateTargetGroups (request )
1284
+ response , err := me .client .UseClbClient ().AssociateTargetGroups (request )
1281
1285
if err != nil {
1282
1286
return retryError (err , InternalError )
1287
+ } else {
1288
+ log .Printf ("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n " ,
1289
+ logId , request .GetAction (), request .ToJsonString (), response .ToJsonString ())
1290
+ requestId := * response .Response .RequestId
1291
+ retryErr := waitForTaskFinish (requestId , me .client .UseClbClient ())
1292
+ if retryErr != nil {
1293
+ return resource .NonRetryableError (errors .WithStack (retryErr ))
1294
+ }
1283
1295
}
1284
1296
return nil
1285
1297
})
@@ -1299,9 +1311,6 @@ func (me *ClbService) DescribeAssociateTargetGroups(ctx context.Context, ids []s
1299
1311
if err != nil {
1300
1312
return retryError (err , InternalError )
1301
1313
}
1302
- if targetInfos == nil || len (targetInfos [0 ].AssociatedRule ) == 0 {
1303
- return resource .RetryableError (fmt .Errorf ("response is nil" ))
1304
- }
1305
1314
return nil
1306
1315
})
1307
1316
if err != nil {
0 commit comments