mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-11 14:09:21 +00:00
Improve condition for checking if CRD file is a URL
Was stumped by this when attempting to include a local CRD file named `httproutes.gateway.networking.k8s.io.json` - which resulted in the following error:
```
ValueError: unknown url type: 'httproutes.gateway.networking.k8s.io.json'
```
Assuming that all`startsWith("http")` was intended to do is discerning local from remote resource references.
This commit is contained in:
parent
1bd44986dd
commit
d2935aa99d
1 changed files with 1 additions and 1 deletions
|
|
@ -127,7 +127,7 @@ if __name__ == "__main__":
|
|||
exit(1)
|
||||
|
||||
for crdFile in sys.argv[1:]:
|
||||
if crdFile.startswith("http"):
|
||||
if crdFile.startswith("http:") or crdFile.startsWith("https:"):
|
||||
f = urllib.request.urlopen(crdFile)
|
||||
else:
|
||||
f = open(crdFile)
|
||||
|
|
|
|||
Loading…
Reference in a new issue