Skip to content

Commit

Permalink
fix: Use async cs client for lb rule deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
hrak committed Aug 15, 2024
1 parent f8d2c27 commit 46ef783
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/cloud/isolated_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,12 @@ func (c *client) ReconcileLoadBalancerRules(isoNet *infrav1.CloudStackIsolatedNe

if !slices.Contains(ports, intport) {
success, err := c.DeleteLoadBalancerRule(ruleID)
if err != nil || !success {
if err != nil {
return errors.Wrap(err, "deleting load balancer rule")
}
if !success {
return errors.New("delete load balancer rule returned unsuccessful")
}
}
}
// Update isoNet status with the current list of loadbalancer rule ID's.
Expand Down Expand Up @@ -326,8 +329,8 @@ func (c *client) CreateLoadBalancerRule(isoNet *infrav1.CloudStackIsolatedNetwor

// DeleteLoadBalancerRule deletes an existing load balancer rule.
func (c *client) DeleteLoadBalancerRule(id string) (bool, error) {
p := c.cs.LoadBalancer.NewDeleteLoadBalancerRuleParams(id)
resp, err := c.cs.LoadBalancer.DeleteLoadBalancerRule(p)
p := c.csAsync.LoadBalancer.NewDeleteLoadBalancerRuleParams(id)
resp, err := c.csAsync.LoadBalancer.DeleteLoadBalancerRule(p)
if err != nil {
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)

Expand Down

0 comments on commit 46ef783

Please sign in to comment.