Skip to content

Commit 294b2d3

Browse files
fix: skip port deletion when instances have no port
1 parent 6df0da0 commit 294b2d3

File tree

1 file changed

+4
-0
lines changed
  • pkg/cloud/services/networking

1 file changed

+4
-0
lines changed

pkg/cloud/services/networking/port.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,10 @@ func (s *Service) GarbageCollectErrorInstancesPort(eventObject runtime.Object, i
315315
return fmt.Errorf("garbage collection of port %s failed, found %d ports with the same name", portName, len(portList))
316316
}
317317

318+
if len(portList) == 0 {
319+
continue
320+
}
321+
318322
if err := s.DeletePort(eventObject, portList[0].ID); err != nil {
319323
return err
320324
}

0 commit comments

Comments
 (0)