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.
 
 

19 lines
502 B

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