Skip to content

Commit

Permalink
Add check for IsNotFound
Browse files Browse the repository at this point in the history
Signed-off-by: Blake Devcich <[email protected]>
  • Loading branch information
bdevcich committed Jan 30, 2024
1 parent d5557a7 commit 45520e5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/controller/lustrefilesystem_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ func (r *LustreFileSystemReconciler) Reconcile(ctx context.Context, req ctrl.Req
// If the namespace doesn't exist, set a flag so that we can appropriately set the status in the mode loop
ns := &corev1.Namespace{}
if err := r.Get(ctx, types.NamespacedName{Name: namespace}, ns); err != nil {
namespacePresent = false
if errors.IsNotFound(err) {
namespacePresent = false
} else {
return ctrl.Result{}, err
}
}

// Create the Status Namespace map if empty
Expand Down

0 comments on commit 45520e5

Please sign in to comment.