mirror of
https://github.com/yannh/kubeconform.git
synced 2026-04-18 18:09:52 +00:00
Update Readme, converter helper script can now reads straight from http
This commit is contained in:
parent
5ada0b67e5
commit
07883b8bb4
2 changed files with 16 additions and 1 deletions
|
|
@ -4,6 +4,7 @@
|
|||
import yaml
|
||||
import json
|
||||
import sys
|
||||
import urllib.request
|
||||
|
||||
def iteritems(d):
|
||||
if hasattr(dict, "iteritems"):
|
||||
|
|
@ -90,7 +91,11 @@ if len(sys.argv) == 0:
|
|||
print("missing file")
|
||||
exit(1)
|
||||
|
||||
with open(sys.argv[1]) as f:
|
||||
if sys.argv[1].startswith("http"):
|
||||
f = urllib.request.urlopen(sys.argv[1])
|
||||
else:
|
||||
f = open(sys.argv[1])
|
||||
with f:
|
||||
y = yaml.load(f, Loader=yaml.SafeLoader)
|
||||
schema = y["spec"]["validation"]["openAPIV3Schema"]
|
||||
schema = additional_properties(schema)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue