-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(kubernetes-ci): install CRDs before linting manifests
Signed-off-by: Siddhesh Mhadnak <[email protected]>
- Loading branch information
Showing
9 changed files
with
4,807 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,6 @@ secrets.yaml | |
|
||
# Helm | ||
kubernetes/chart/charts/*.tgz | ||
|
||
# Python | ||
.venv/ |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env python3 | ||
"""Search for Kubernetes manifests in the kubernetes/manifests/ directory.""" | ||
|
||
from __future__ import annotations | ||
|
||
from pathlib import Path | ||
|
||
|
||
def main() -> None: | ||
"""Search for Kubernetes manifests in the kubernetes/manifests/ directory.""" | ||
manifests_dir = Path(__file__).parents[2] / "kubernetes/manifests" | ||
|
||
for path in manifests_dir.rglob("*.yaml"): | ||
if ( | ||
# Ignore manifests that start with _ | ||
not path.name.startswith("_") | ||
# Path is likely a Kubernetes manifest | ||
and "apiVersion:" in path.read_text() | ||
): | ||
print(path) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env python3 | ||
"""Install Kubernetes CRDs.""" | ||
|
||
from __future__ import annotations | ||
|
||
from pathlib import PurePath | ||
|
||
from kubernetes import client, config, utils | ||
|
||
|
||
def main() -> None: | ||
"""Install Kubernetes CRDs.""" | ||
config.load_kube_config() | ||
api_client = client.ApiClient() | ||
|
||
crd_dir = PurePath(__file__).parents[2] / "kubernetes/crds" | ||
|
||
try: | ||
utils.create_from_directory(api_client, yaml_dir=crd_dir, verbose=True) | ||
except utils.FailToCreateError: | ||
print("Failed to create some CRDs") | ||
raise | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
kubernetes==27.* |
Oops, something went wrong.