Skip to content

Commit 5e4f26f

Browse files
committed
remove CreateCLBAsync
Signed-off-by: roc <roc@imroc.cc>
1 parent 6b8e3ee commit 5e4f26f

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

pkg/clb/instance.go

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -163,31 +163,6 @@ func CreateCLB(ctx context.Context, region string, req *clb.CreateLoadBalancerRe
163163
return
164164
}
165165

166-
func CreateCLBAsync(ctx context.Context, region string, req *clb.CreateLoadBalancerRequest) (lbId string, result <-chan error, err error) {
167-
client := GetClient(region)
168-
resp, err := client.CreateLoadBalancerWithContext(ctx, req)
169-
if err != nil {
170-
return
171-
}
172-
ids := resp.Response.LoadBalancerIds
173-
if len(ids) == 0 || *ids[0] == "" {
174-
err = fmt.Errorf("no loadbalancer created")
175-
return
176-
}
177-
lbId = *ids[0]
178-
ret := make(chan error)
179-
result = ret
180-
go func() {
181-
if _, err := Wait(ctx, region, *resp.Response.RequestId, "CreateLoadBalancer"); err != nil {
182-
log.FromContext(ctx).Error(err, "clb create task failed", "lbId", lbId)
183-
ret <- err
184-
return
185-
}
186-
ret <- nil
187-
}()
188-
return
189-
}
190-
191166
type CLBInfo struct {
192167
LoadbalancerID string
193168
LoadbalancerName string

0 commit comments

Comments
 (0)