From f2d3117089c807feda5ada86c3b10a1088029ecc Mon Sep 17 00:00:00 2001 From: Blake Devcich Date: Fri, 26 Jan 2024 10:05:31 -0600 Subject: [PATCH] sticky pending --- internal/controller/lustrefilesystem_controller.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/internal/controller/lustrefilesystem_controller.go b/internal/controller/lustrefilesystem_controller.go index 87fa611..7391b41 100644 --- a/internal/controller/lustrefilesystem_controller.go +++ b/internal/controller/lustrefilesystem_controller.go @@ -148,11 +148,9 @@ func (r *LustreFileSystemReconciler) Reconcile(ctx context.Context, req ctrl.Req } } - // If the Status Namespace doesn't have a mode, create it and mark it as Pending - if _, found := fs.Status.Namespaces[namespace].Modes[mode]; !found { - fs.Status.Namespaces[namespace].Modes[mode] = lusv1beta1.LustreFileSystemNamespaceAccessStatus{ - State: lusv1beta1.NamespaceAccessPending, - } + // Default the status as Pending in case the create/updates fail + fs.Status.Namespaces[namespace].Modes[mode] = lusv1beta1.LustreFileSystemNamespaceAccessStatus{ + State: lusv1beta1.NamespaceAccessPending, } // Attempt to create the PV, if it fails, the status will be marked as Pending