-
Notifications
You must be signed in to change notification settings - Fork 161
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
Mark aggregated condition ready only when No error happened #184
Conversation
/assign @barney-s |
@@ -96,7 +96,7 @@ func (r *ApplicationReconciler) getNewApplicationStatus(ctx context.Context, app | |||
Objects: objectStatuses, | |||
} | |||
newApplicationStatus.ComponentsReady = fmt.Sprintf("%d/%d", countReady, len(objectStatuses)) | |||
if aggReady && errs != nil { | |||
if aggReady && errs == nil { | |||
setReadyCondition(newApplicationStatus, "ComponentsReady", "all components ready") | |||
} else { | |||
setNotReadyCondition(newApplicationStatus, "ComponentsNotReady", "some components not ready") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible that all components are ready but there's an error ?
I assume yes, the message / status should reflect that or it's still confusing.
The status would be in error with "some components not ready", as a user I would check which components isn't ready but won't find any....
Could we add a separate case:
something like :
if errs != nil {
"there's an error"
} else if aggReady {
"all components ready"
} else
{
"some components not ready" // 'some' could be replaced with (len(objectStatuses)-countReady)
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two types of conditions: Ready
and Error
and we need to set both.
I think we can leverage the Unknown
status for the Ready
condition:
if errs != nil {
//set ready condition to unknown
} else if aggReady {
"all components ready"
} else {
"x components not ready"
}
if errs != nil {
setErrorCondition
} else {
clearErrorCondition
}
Example when errors happened in aggregating statuses:
|
thank you, |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ant31, nan-yu The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fixes #183