mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-25 12:47:01 +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)
|
f = open(crdFile)
|
||||||
with f:
|
with f:
|
||||||
for y in yaml.load_all(f, Loader=yaml.SafeLoader):
|
for y in yaml.load_all(f, Loader=yaml.SafeLoader):
|
||||||
|
if y is None:
|
||||||
|
continue
|
||||||
if "kind" not in y:
|
if "kind" not in y:
|
||||||
continue
|
continue
|
||||||
if y["kind"] != "CustomResourceDefinition":
|
if y["kind"] != "CustomResourceDefinition":
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue