-
Notifications
You must be signed in to change notification settings - Fork 958
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
Add unknown field check to beta validate
#5791
Conversation
83eabe5
to
5789c5f
Compare
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.
Super cool @enesonus to see the validate
functionality getting extended with more useful checks - great start to your LFX mentorship summer 💪
All the validation looks to be working correctly, I've added just a few comments for you to consider 🙇♂️
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.
OK @enesonus, I responded to the comments here, so please go ahead and update the code to use the invalid error type, and then add some unit tests (e.g. new test cases in validate_test.go
) 🙇♂️
Signed-off-by: Mehmet Enes <[email protected]>
Signed-off-by: Mehmet Enes <[email protected]>
Signed-off-by: Mehmet Enes <[email protected]>
1d70da9
to
6170555
Compare
Signed-off-by: Mehmet Enes <[email protected]>
6170555
to
c369af4
Compare
Signed-off-by: Mehmet Enes <[email protected]>
@enesonus thanks for the PR! This is the most requested/asked functionality for the validate command. Do you mind updating the example in the PR description with your latest changes (e.g., Internal error vs Invalid)? |
Thanks for the reminder! I updated it to the latest error string now. |
Signed-off-by: Mehmet Enes <[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.
This functionality looks great now, let's get it merged in so it can ship in v1.17! 🎉
Description of your changes
This PR implements a validation logic that use pruning to get the unknown fields of a resource. With the help of this new validation step we can get informed about the typos and indentation errors.
Here are some examples of this new validation:
xrd.yaml
xr.yaml:
Output:
crossplane beta render
function with field errors at composition:Uses jbw976/demo-upbound@38017fa which has a typo, indentation error and unknown field
Fixes: #5376
I added the relevant changes made in this PR to docs: crossplane/docs#790
I have:
earthly +reviewable
to ensure this PR is ready for review.Added or updated e2e tests.Addedbackport release-x.y
labels to auto-backport this PR.Need help with this checklist? See the cheat sheet.