Collect Validate errors for a resource and display them at once #16207
+85
−46
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
MMv1 errors are inconsistent in how much information is available. Some format strings show the affected property/resource and others don't. I'm looking to clear that up- as well as stop the process dying from a
log.Fatalfon any issue. Since Validate does surface-level checking of yaml data we can typically proceed after seeing an error, allowing us to collect multiple errors instead of dying immediately.We could theoretically push this further- since resources are mostly or entirely independent- and collect errors across all files before dying. For now I collected all errors in the current resource, prefixed them all with the resource file they came from, and sent a fatal error after validating the entire resource. Currently a draft, looking for any thoughts/concerns/feedback before cleaning up and creating a merge-ready PR.
Release Note Template for Downstream PRs (will be copied)
See Write release notes for guidance.