-
Notifications
You must be signed in to change notification settings - Fork 795
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
feat: report ArgoCD errors via .status.conditions field #1608
Conversation
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.
Looks great @jparsai, one additional request in addition to what is described below.
Part of this story is ensuring that the error messages that we are setting are user friendly.
AFAICT if you search for the following strings in the code, you will find cases where we are creating new errors:
errors.New
fmt.Errorf
I did that, and one thing I noticed is there are cases where there are error log statement are very user-friendly, and then below them is an error which is very user unfriendly:
reqLogger.Info(fmt.Sprintf("the ArgoCD instance '%s' does not match the label selector '%s' and skipping for reconciliation", request.NamespacedName, r.LabelSelector)) log.Error(err, fmt.Sprintf("Arg %s is already part of the default command arguments", arg))
In these cases, I think we should make the error returned just as 'friendly' as the log statement logging the error case. AFAICT there is no reason to not have the error message be the same as the logged error message, as the logger error message provided much more datail.
It would also be beneficial to look at the error messages in general, by searching for the strings mentioned above. See if you can decide if they can be improved to provide better context for what the Argo CD operator was doing when the error occurred. (where possible)
e1224cb
to
fbe8398
Compare
f26a551
to
7ae34e4
Compare
Signed-off-by: Jayendra Parsai <[email protected]>
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.
LGTM, thanks @jparsai! As mentioned, I've been very much looking forward to this feature 😄.
What type of PR is this?
/kind enhancement
What does this PR do / why we need it:
This PR is to add a new
Conditions
field inStatus
of ArgoCD CR which would contain a single condition of 'Type: Reconciled' for any error that occurs.Which issue(s) this PR fixes:
Red Hat issue tracker :- https://issues.redhat.com/browse/GITOPS-5876
How to test changes / Special notes to the reviewer:
.status.conditions
field should be updated based on error or success.