kube-linter icon indicating copy to clipboard operation
kube-linter copied to clipboard

Improved errors for invalid yaml files

Open IAmATeaPot418 opened this issue 3 years ago • 3 comments

Today, kube-linter shows the output Warning: no valid objects found. when there is an invalid yaml file.

The error messages could be made more clear. Rather than asking users to use verbose logging kube-linter lint -v pod.yaml we should display errors that showcase what the issue is. I think it would be ideal to have custom error conditions to show users why something is not valid.

Option 1: The file scanned at ./pod.yaml is not a valid yaml file. Please check to ensure the file is in proper yaml format. Option 2: The file scanned is not a valid kubernetes object please run kube-linter lint -v pod.yaml for more details.

Alternatively, we could also point them to run kube-linter lint -v pod.yaml for more details directly in the error.

IAmATeaPot418 avatar Nov 11 '20 03:11 IAmATeaPot418

This is partially solve by #279 As @IAmATeaPot418 mentioned for better UX we should inform user about --fail-on-invalid-resource and -v options and enable fail-on-invalid-resource as default from next major release.

janisz avatar Apr 15 '22 14:04 janisz

Is there support for --fail-on-invalid-resource in the Github action? Is there a way to enable the setting via config file kube-linter.yaml ?

ThZev avatar Jan 26 '23 14:01 ThZev

Indeed it's not exposed in config nor available in the action.

janisz avatar Apr 11 '23 10:04 janisz