From cda5204a3d1e2284a64eb55d7df4a453caffcf6d Mon Sep 17 00:00:00 2001 From: Blake Devcich Date: Mon, 29 Jan 2024 14:18:36 -0600 Subject: [PATCH] more debug cleanup --- internal/controller/lustrefilesystem_controller.go | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/internal/controller/lustrefilesystem_controller.go b/internal/controller/lustrefilesystem_controller.go index a2747a3..e3e26fa 100644 --- a/internal/controller/lustrefilesystem_controller.go +++ b/internal/controller/lustrefilesystem_controller.go @@ -75,11 +75,8 @@ type LustreFileSystemReconciler struct { // For more details, check Reconcile and its Result here: // - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.10.0/pkg/reconcile func (r *LustreFileSystemReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, err error) { - log.FromContext(ctx).Info("Reconciler Start") - fs := &lusv1beta1.LustreFileSystem{} if err := r.Get(ctx, req.NamespacedName, fs); err != nil { - log.FromContext(ctx).Info("NOT FOUND") return ctrl.Result{}, client.IgnoreNotFound(err) } @@ -137,7 +134,6 @@ func (r *LustreFileSystemReconciler) Reconcile(ctx context.Context, req ctrl.Req // Iterate over the access modes in the specification. For each namespace in that mode // create a PV/PVC which can be used by pods in the same namespace. for namespace := range fs.Spec.Namespaces { - // log.FromContext(ctx).Info("Reconcile Spec Namespace", "namespace", namespace) namespacePresent := true // If the namespace doesn't exist, set a flag so that we can appropriately set the status in the mode loop @@ -151,10 +147,8 @@ func (r *LustreFileSystemReconciler) Reconcile(ctx context.Context, req ctrl.Req fs.Status.Namespaces = make(map[string]lusv1beta1.LustreFileSystemNamespaceStatus) } - // For each mode in the namespace + // For each mode listed for the namespace for _, mode := range fs.Spec.Namespaces[namespace].Modes { - // log.FromContext(ctx).Info("Processing Spec Namespace Mode", "mode", mode) - // Create the Status Namespace Mode map if empty if fs.Status.Namespaces[namespace].Modes == nil { fs.Status.Namespaces[namespace] = lusv1beta1.LustreFileSystemNamespaceStatus{ @@ -169,7 +163,6 @@ func (r *LustreFileSystemReconciler) Reconcile(ctx context.Context, req ctrl.Req // If the namespace is not present or is not active, continue on and the status will be marked as Pending if !namespacePresent || ns.Status.Phase != corev1.NamespaceActive { - log.FromContext(ctx).Info("Namespace does not exist or is not active, skipping...", "namespace", namespace) continue } @@ -200,11 +193,7 @@ func (r *LustreFileSystemReconciler) Reconcile(ctx context.Context, req ctrl.Req // Remove any resources that are not in the spec for namespace := range fs.Status.Namespaces { - // log.FromContext(ctx).Info("Reconcile Status Namespace", "namespace", namespace) - for mode := range fs.Status.Namespaces[namespace].Modes { - // log.FromContext(ctx).Info("Processing Status Namespace Mode", "mode", mode) - // Check if the provided namespace and mode are present in the specification isPresentInSpec := func(namespace string, mode corev1.PersistentVolumeAccessMode) bool { if ns, found := fs.Spec.Namespaces[namespace]; found { @@ -368,6 +357,7 @@ func (r *LustreFileSystemReconciler) deleteAccess(ctx context.Context, fs *lusv1 return nil } +// For a change with any namespace, we need to go through the list of all the lustrefilesystem resources func (r *LustreFileSystemReconciler) getLustreFileSystemsHandler(ctx context.Context, o client.Object) []reconcile.Request { var res []reconcile.Request