Skip to content

Commit

Permalink
Merge pull request #60 from backguynn/main
Browse files Browse the repository at this point in the history
Check http statusCode when delete loxilb's LB rule
  • Loading branch information
backguynn authored Oct 13, 2023
2 parents 8bcbfef + 173ae15 commit abfcd01
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/api/lb.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package api
import (
"context"
"fmt"
"net/http"
)

type EpSelect uint
Expand Down Expand Up @@ -128,8 +129,10 @@ func (l *LoadBalancerAPI) Delete(ctx context.Context, lbModel LoxiModel) error {
}

resp := l.client.DELETE(l.resource).SubResource(subresources).Query(queryParam).Body(lbModel).Do(ctx)
if resp.err != nil {
return resp.err
if resp.statusCode != http.StatusOK {
if resp.err != nil {
return resp.err
}
}

return nil
Expand Down

0 comments on commit abfcd01

Please sign in to comment.