-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
2 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,11 +75,8 @@ type LustreFileSystemReconciler struct { | |
// For more details, check Reconcile and its Result here: | ||
// - https://pkg.go.dev/sigs.k8s.io/[email protected]/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 | ||
|
||
|