Skip to content

Commit 901fff4

Browse files
committed
fixup! refactor: Add review feedback
1 parent 6b6da2a commit 901fff4

File tree

1 file changed

+11
-4
lines changed
  • pkg/handlers/generic/lifecycle/serviceloadbalancer/metallb

1 file changed

+11
-4
lines changed

pkg/handlers/generic/lifecycle/serviceloadbalancer/metallb/handler.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,20 @@ func (n *MetalLB) Apply(
162162
},
163163
},
164164
); err != nil {
165-
// Return early if the error is not a conflict or an internal error.
166-
// Internal errors are generally seen when the necessary CRD webhooks are not yet registered so are
167-
// retryable.
168-
if !apierrors.IsConflict(err) && !apierrors.IsInternalError(err) {
165+
if apierrors.IsInternalError(err) {
166+
// Retry on internal errors as these are generally seen when the necessary
167+
// CRD webhooks are not yet registered.
168+
return false, nil
169+
}
170+
171+
// Return early if the error is not a conflict.
172+
if !apierrors.IsConflict(err) {
169173
return false, err
170174
}
171175

176+
// At this point, we have handled both internal and non-conflict errors,
177+
// so we must be dealing with a conflict.
178+
172179
// Set the error message based on the type of the object.
173180
switch o.(type) {
174181
case *metallbv1.IPAddressPool:

0 commit comments

Comments
 (0)