Skip to content

Commit f00edc4

Browse files
committed
Config: Comment r.Get to clarify why types.NamespacedName is needed
Signed-off-by: Andreas Karis <[email protected]>
1 parent a0212de commit f00edc4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

controllers/bpfman-operator/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ func (r *BpfmanConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request
9494
r.Logger.Info("Running the reconciler")
9595

9696
bpfmanConfig := &v1alpha1.Config{}
97+
// We must use types.NamespacedName{Name: req.NamespacedName.Name} instead of req.NamespacedName. Otherwise, the
98+
// mocks in config_test.go fail as they populate the namespace in the reconciler.
9799
if err := r.Get(ctx, types.NamespacedName{Name: req.NamespacedName.Name}, bpfmanConfig); err != nil {
98100
// If the resource is not found then it usually means that it was deleted or not created
99101
// In this way, we will stop the reconciliation

0 commit comments

Comments
 (0)