mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-11 14:09:21 +00:00
Skip empty yaml docs - for yaml files with a structure like
``` # comment --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition ```
This commit is contained in:
parent
fa1cb37020
commit
d94454920b
1 changed files with 2 additions and 0 deletions
|
|
@ -114,6 +114,8 @@ for crdFile in sys.argv[1:]:
|
|||
f = open(crdFile)
|
||||
with f:
|
||||
for y in yaml.load_all(f, Loader=yaml.SafeLoader):
|
||||
if y is None:
|
||||
continue
|
||||
if "kind" not in y:
|
||||
continue
|
||||
if y["kind"] != "CustomResourceDefinition":
|
||||
|
|
|
|||
Loading…
Reference in a new issue