The kube merge files, which are stored under envs/{env}/merges/.../kube/ can't in many cases be validated by kubeval. This is why I've submitted a PR #39 to for the time being skip the validation of these files.
They could be validated to be valid YAML files, but kubeval validates more than that; it validates they are YAML files that kubernetes will understand. The merge files often contain partial files, like this one (fetched from devops/tests/test_utils.py):
If you try to run kubeval on that file, it'll report:
ERR - merge-example.yaml: Missing 'kind' key
In order to be able to fully validate the merge files directly using kubeval it'd mean that the basic idea of just overriding the necessary parts of the file would be gone, as one would have to add all the keys that are mandatory for that kind of document.
The best idea I can think of for validating these files would be to skip the validation of the merge files as stand alone files and perform the merge of the main file and the merge file to form a full YAML file and feed that to kubeval for validation instead.
The kube merge files, which are stored under
envs/{env}/merges/.../kube/
can't in many cases be validated bykubeval
. This is why I've submitted a PR #39 to for the time being skip the validation of these files.They could be validated to be valid YAML files, but kubeval validates more than that; it validates they are YAML files that kubernetes will understand. The merge files often contain partial files, like this one (fetched from
devops/tests/test_utils.py
):If you try to run kubeval on that file, it'll report:
ERR - merge-example.yaml: Missing 'kind' key
In order to be able to fully validate the merge files directly using kubeval it'd mean that the basic idea of just overriding the necessary parts of the file would be gone, as one would have to add all the keys that are mandatory for that kind of document.
The best idea I can think of for validating these files would be to skip the validation of the merge files as stand alone files and perform the merge of the main file and the merge file to form a full YAML file and feed that to
kubeval
for validation instead.