Skip empty yaml docs - for yaml files with a structure like

```
# comment
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
```
This commit is contained in:
David Holsgrove 2021-05-24 16:05:19 +10:00
parent fa1cb37020
commit d94454920b
No known key found for this signature in database
GPG key ID: 5C059FB12A14F42B

View file

@ -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":