From 661f49409e69f5cfafbef4cd41411a72ebc5418d Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Sun, 13 Aug 2023 20:01:42 +0100 Subject: Copy all files from kubernetes repo into this one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit is a like-for-like copy of the [kubernetes repo](https://github.com/python-discord/kubernetes) check that repo for comit history prioir to this commit. Co-authored-by: Amrou Bellalouna Co-authored-by: Bradley Reynolds Co-authored-by: Chris Co-authored-by: Chris Lovering Co-authored-by: ChrisJL Co-authored-by: Den4200 Co-authored-by: GDWR Co-authored-by: Hassan Abouelela Co-authored-by: Hassan Abouelela Co-authored-by: jchristgit Co-authored-by: Joe Banks <20439493+jb3@users.noreply.github.com> Co-authored-by: Joe Banks Co-authored-by: Joe Banks Co-authored-by: Johannes Christ Co-authored-by: Kieran Siek Co-authored-by: kosayoda Co-authored-by: ks129 <45097959+ks129@users.noreply.github.com> Co-authored-by: Leon Sand├©y Co-authored-by: Leon Sand├©y Co-authored-by: MarkKoz Co-authored-by: Matteo Bertucci Co-authored-by: Sebastiaan Zeeff <33516116+SebastiaanZ@users.noreply.github.com> Co-authored-by: Sebastiaan Zeeff Co-authored-by: vcokltfre --- kubernetes/scripts/lint_manifests.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 kubernetes/scripts/lint_manifests.py (limited to 'kubernetes/scripts/lint_manifests.py') diff --git a/kubernetes/scripts/lint_manifests.py b/kubernetes/scripts/lint_manifests.py new file mode 100644 index 0000000..8660608 --- /dev/null +++ b/kubernetes/scripts/lint_manifests.py @@ -0,0 +1,28 @@ +import os +import sys +from pathlib import Path + + +def get_all_manifests() -> list[str]: + """Return a list of file paths that look like k8s manifests.""" + likely_manifests = [] + for file in Path.cwd().glob("**/*.yaml"): + if file.name in ("secrets.yaml", "ghcr-pull-secrets.yaml"): + # Don't lint secret files as they're git-crypted + continue + if file.stem.startswith("_"): + # Ignore manifests that start with _ + continue + if "apiVersion:" not in file.read_text(): + # Probably not a manifest + continue + likely_manifests.append(str(file)) + return likely_manifests + + +if __name__ == "__main__": + if sys.argv[1] == "diff": + arg = " -f ".join([""] + get_all_manifests()) + os.system("kubectl diff" + arg) # noqa: S605 + elif sys.argv[1] == "find": + print("\n".join(get_all_manifests())) # noqa: T201 -- cgit v1.2.3