-
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
9 additions
and
0 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 |
---|---|---|
|
@@ -70,6 +70,7 @@ 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 { | ||
|
@@ -130,12 +131,17 @@ 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("spec namespace loop start", "namespace", namespace) | ||
|
||
if fs.Status.Namespaces == nil { | ||
fs.Status.Namespaces = make(map[string]lusv1beta1.LustreFileSystemNamespaceStatus) | ||
log.FromContext(ctx).Info("spec namespace loop status nil", "namespace", namespace) | ||
} else { | ||
log.FromContext(ctx).Info("spec namespace loop status list", "status.namespaces", fs.Status.Namespaces) | ||
} | ||
|
||
for _, mode := range fs.Spec.Namespaces[namespace].Modes { | ||
log.FromContext(ctx).Info("spec namespace loop mode loop", "mode", mode) | ||
|
||
if fs.Status.Namespaces[namespace].Modes == nil { | ||
fs.Status.Namespaces[namespace] = lusv1beta1.LustreFileSystemNamespaceStatus{ | ||
|
@@ -147,6 +153,7 @@ func (r *LustreFileSystemReconciler) Reconcile(ctx context.Context, req ctrl.Req | |
fs.Status.Namespaces[namespace].Modes[mode] = lusv1beta1.LustreFileSystemNamespaceAccessStatus{ | ||
State: lusv1beta1.NamespaceAccessPending, | ||
} | ||
log.FromContext(ctx).Info("spec namespace loop mode loop state pending") | ||
} | ||
|
||
status := fs.Status.Namespaces[namespace].Modes[mode] | ||
|
@@ -170,6 +177,8 @@ func (r *LustreFileSystemReconciler) Reconcile(ctx context.Context, req ctrl.Req | |
Name: pvc.Name, | ||
}, | ||
} | ||
} else { | ||
log.FromContext(ctx).Info("spec namespace loop mode loop status is not ready", "state", status.State) | ||
} | ||
} | ||
} | ||
|