Kubernetes manifest linter using JSON Schema
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

20 lines
502 B

  1. #!/usr/bin/env python
  2. import json
  3. import sys
  4. from pathlib import Path
  5. # source should contain clone of https://github.com/instrumenta/kubernetes-json-schema
  6. source = Path(sys.argv[1])
  7. kubernetes_version = "v1.17.0"
  8. dest = Path("kube_manifest_lint/schemas") / kubernetes_version
  9. dest.mkdir(exist_ok=True)
  10. for path in source.glob(f"{kubernetes_version}-local/*.json"):
  11. with path.open() as fd:
  12. data = json.load(fd)
  13. with (dest / path.name).open("w") as fd:
  14. json.dump(data, fd)