-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
🌱 Improve Cluster variable defaulting/validation errors #9452
🌱 Improve Cluster variable defaulting/validation errors #9452
Conversation
Signed-off-by: Stefan Büringer [email protected]
@@ -49,8 +50,11 @@ func defaultClusterVariables(values []clusterv1.ClusterVariable, definitions []c | |||
// - variables with the same name do not have a mix of empty and non-empty DefinitionFrom. | |||
valuesIndex, err := newValuesIndex(values) | |||
if err != nil { |
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.
TIL: Technically we produce this error during defaulting and validation, so we have two of them. But this gets deduplicated during error aggregation in apierrors.NewInvalid
Is DefinitionFrom always empty? If yes I think we should not add all this and the error may be sufficient? otherwise lgtm |
No it is not always empty. It can also vary between variables (we also have it in other errors and it can be crucial to understand what is wrong). But I agree it is confusing in the cases where it is empty. Maybe we should do a follow-up to audit all our variable errors to try to simplify in cases where it is empty and we can. I could also implement basically an "omitempty" in this error. |
@killianmuldoon WDYT? |
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.
/area clusterclass
IMO this is a really big improvement as-is, and I don't think we need to complicate it. /lgtm |
LGTM label has been added. Git tree hash: 511bb48957a192cc440e5e2c3f7e63c8ed925d3e
|
Alrighty. Let's go with that one as is then /approve |
I would cherry-pick into release-1.5 as it's a significant improvement to our error messages and it falls under the "experimental feature" clause of our backport policy |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sbueringer 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 |
/cherry-pick release-1.5 |
@sbueringer: once the present PR merges, I will cherry-pick it on top of release-1.5 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@sbueringer: new pull request created: #9479 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: Stefan Büringer [email protected]
What this PR does / why we need it:
Before
After
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #