Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why did we set phase Ready of modes that were not mapped? #1061

Open
shirady opened this issue Feb 22, 2023 · 1 comment
Open

Why did we set phase Ready of modes that were not mapped? #1061

shirady opened this issue Feb 22, 2023 · 1 comment
Labels
question Something is not clear or information is missing

Comments

@shirady
Copy link
Contributor

shirady commented Feb 22, 2023

Inside the reconciler of backingstore we have modeInfoMap.

func modeInfoMap() map[string]ModeInfo {
return map[string]ModeInfo{
"INITIALIZING": {nbv1.BackingStorePhaseCreating, corev1.EventTypeNormal},
"DELETING": {nbv1.BackingStorePhaseReady, corev1.EventTypeNormal},
"SCALING": {nbv1.BackingStorePhaseReady, corev1.EventTypeNormal},
"MOST_NODES_ISSUES": {nbv1.BackingStorePhaseReady, corev1.EventTypeWarning},
"MANY_NODES_ISSUES": {nbv1.BackingStorePhaseReady, corev1.EventTypeWarning},
"MOST_STORAGE_ISSUES": {nbv1.BackingStorePhaseReady, corev1.EventTypeWarning},
"MANY_STORAGE_ISSUES": {nbv1.BackingStorePhaseReady, corev1.EventTypeWarning},
"MANY_NODES_OFFLINE": {nbv1.BackingStorePhaseReady, corev1.EventTypeWarning},
"LOW_CAPACITY": {nbv1.BackingStorePhaseReady, corev1.EventTypeWarning},
"OPTIMAL": {nbv1.BackingStorePhaseReady, corev1.EventTypeNormal},
"HAS_NO_NODES": {nbv1.BackingStorePhaseRejected, corev1.EventTypeWarning},
"ALL_NODES_OFFLINE": {nbv1.BackingStorePhaseRejected, corev1.EventTypeWarning},
"NO_CAPACITY": {nbv1.BackingStorePhaseRejected, corev1.EventTypeWarning},
"IO_ERRORS": {nbv1.BackingStorePhaseRejected, corev1.EventTypeWarning},
"STORAGE_NOT_EXIST": {nbv1.BackingStorePhaseRejected, corev1.EventTypeWarning},
"AUTH_FAILED": {nbv1.BackingStorePhaseRejected, corev1.EventTypeWarning},
}
}

inside the function completeReconcile we set the phase Ready to modes that were not mapped in modeInfoMap.

} else {
// We will get here in case we do not have a mapping inside bsModeInfoMap
// The default phase that was chosen was phase ready
r.SetPhase(
nbv1.BackingStorePhaseReady,
"BackingStorePhaseReady",
"noobaa operator completed reconcile - backing store is ready",
)

The open questions are:

  1. Why did we choose to set the phase as Ready?
  2. Is there a reason that we will not map explicitly all the modes from core inside modeInfoMap?
@shirady
Copy link
Contributor Author

shirady commented Feb 22, 2023

We started the discussion in PR #1033 (exactly here), to separate the issues I opened this one.

@shirady shirady added the question Something is not clear or information is missing label Feb 22, 2023
@shirady shirady changed the title Why did we set phase Ready of mode that were not mapped? Why did we set phase Ready of modes that were not mapped? Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Something is not clear or information is missing
Projects
None yet
Development

No branches or pull requests

1 participant