mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-22 03:07:01 +00:00
support for multi-document yaml in openapi2jsonschema
This commit is contained in:
parent
509ad8e997
commit
f6e6f7584c
1 changed files with 33 additions and 28 deletions
|
|
@ -98,7 +98,12 @@ for crdFile in sys.argv[1:]:
|
||||||
else:
|
else:
|
||||||
f = open(crdFile)
|
f = open(crdFile)
|
||||||
with f:
|
with f:
|
||||||
y = yaml.load(f, Loader=yaml.SafeLoader)
|
for y in yaml.load_all(f, Loader=yaml.SafeLoader):
|
||||||
|
if "kind" not in y:
|
||||||
|
continue
|
||||||
|
if y["kind"] != "CustomResourceDefinition":
|
||||||
|
continue
|
||||||
|
|
||||||
filename = ""
|
filename = ""
|
||||||
schemaJSON = ""
|
schemaJSON = ""
|
||||||
if "spec" in y and "validation" in y["spec"] and "openAPIV3Schema" in y["spec"]["validation"]:
|
if "spec" in y and "validation" in y["spec"] and "openAPIV3Schema" in y["spec"]["validation"]:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue