Log more info when validation fails due to unexpected fields on a resource #94
Labels
good first issue
Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.
kind/feature
Categorizes issue or PR as related to a new feature.
What would you like to be added?
When validating a resource, if there's, let's say a typo on a property, the validation results in an error where no reference to the resource that failed to validate is logged. When validating a file with several resources in it, it's hard to find which to find which one errored.
Example:
Error message:
datas: Invalid value: value provided for unknown field
So no reference to name and kind of the resource.
This happens as when resource parsing fails, it errors without parsing metadata's name. Group and kind are returned but not attached to the error.
kubectl-validate/pkg/validator/validator.go
Line 82 in e1c86cc
Feels like getting this basic info on the resource could be done at parse function?
Why is this needed?
It will help identifying the resource that caused the error.
The text was updated successfully, but these errors were encountered: