π Description
controllers/slicegateway/reconciler.go lines 134β138:
if slice.Status.SliceConfig != nil &&
slice.Status.SliceConfig.SliceOverlayNetworkDeploymentMode == v1alpha1.NONET {
log.Info("No communication slice. Skipping slicegw reconcilation")
return ctrl.Result{}, err // err is nil here but variable reuse is confusing
}
err at this point holds the result from controllers.GetSlice (line 122), which is nil if the slice was found. While this works correctly, using err in the return obscures that this is an intentional early exit with no error. Future readers may not trace back to verify err is nil, and a refactor that moves this block could silently break.
π Reproduction steps
Read controllers/slicegateway/reconciler.go lines 122β138.
π Expected behavior
return ctrl.Result{}, nil to make the intent explicit.
π Actual Behavior
return ctrl.Result{}, err where err happens to be nil but is not obviously so.
π Relevant log output
Version
No response
π₯οΈ What operating system are you seeing the problem on?
No response
β
Proposed Solution
Replace return ctrl.Result{}, err with return ctrl.Result{}, nil.
π Have you spent some time to check if this issue has been raised before?
Code of Conduct
π Description
controllers/slicegateway/reconciler.golines 134β138:errat this point holds the result fromcontrollers.GetSlice(line 122), which isnilif the slice was found. While this works correctly, usingerrin the return obscures that this is an intentional early exit with no error. Future readers may not trace back to verifyerris nil, and a refactor that moves this block could silently break.π Reproduction steps
Read
controllers/slicegateway/reconciler.golines 122β138.π Expected behavior
return ctrl.Result{}, nilto make the intent explicit.π Actual Behavior
return ctrl.Result{}, errwhereerrhappens to be nil but is not obviously so.π Relevant log output
Version
No response
π₯οΈ What operating system are you seeing the problem on?
No response
β Proposed Solution
Replace
return ctrl.Result{}, errwithreturn ctrl.Result{}, nil.π Have you spent some time to check if this issue has been raised before?
Code of Conduct