Open IAmATeaPot418 opened 4 years ago
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.
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
?
Indeed it's not exposed in config nor available in the action.
As a DevOps Engineer I want to have one tool to make all checks regarding k8s yaml files. Let's say:
kustomize.yaml
and bunch of manifests$ kustomize build .
Error: accumulating resources: accumulating resources from '30-comtelml.registry.yaml': MalformedYAMLError: yaml: line 17: mapping values are not allowed in this context in File: 30-comtelml.registry.yaml
gaal@bigsur apps % kustomize build .
so it means that I need to use more tools than it could be possible.
BTW, the key mentioned before --fail-on-invalid-resource
- is not detecting the issue as well.
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.