yannh / kubeconform

A FAST Kubernetes manifests validator, with support for Custom Resources!
Apache License 2.0
2.07k stars 116 forks source link

Missing file is never reached in openapi2jsonschema.py #239

Closed AndersBennedsgaard closed 8 months ago

AndersBennedsgaard commented 8 months ago

I needed a tool to convert Kubernetes CRDs into JSON schemas, and found your awesome openapi2jsonschema.py script. Looking through it, I noticed

https://github.com/yannh/kubeconform/blob/b7d7b4d0dc2f0206c6a682247cbab6364d544e7b/scripts/openapi2jsonschema.py#L124-L127

As I understand sys.argv this if-statement will never be true since the first entry in the sys.argv list will always be the file name, and therefore the length of the list will never be 0.

yannh commented 8 months ago

Thanks for the report, that seems correct! :+1:

yannh commented 8 months ago

Fixed in https://github.com/yannh/kubeconform/pull/244