Skip to content

Commit 416cf16

Browse files
authored
Merge pull request #2 from serverscom/fix-delete-lb
fix case when lb already deleted
2 parents a5f2af6 + 1a86153 commit 416cf16

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/service/lb/manager.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ func (s *Manager) DeleteLB(ctx context.Context, labelSelector string) error {
8484
if err != nil {
8585
return utils.IgnoreNotFound(err)
8686
}
87+
if len(lbs) == 0 {
88+
// consider as already deleted
89+
return nil
90+
}
8791
if len(lbs) > 1 {
8892
return fmt.Errorf("found more than one lb with same label")
8993
}

0 commit comments

Comments
 (0)