forked from jupyterhub/zero-to-jupyterhub-k8s
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: stop using kubeval and rely on helm template --validate
kubeval and the json schemas is a project with too little maintainers, so now we can't validate against k8s 1.19 or 1.20. Thankfully, we have helm template --validate now that allow us to use a k8s api-server to validate that our rendered templates are valid k8s resources. By running a helm template --validate step with the lint-and-validate-values.yaml we can ensure that they are valid.
- Loading branch information
1 parent
80ad088
commit 559452d
Showing
3 changed files
with
13 additions
and
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,30 +41,18 @@ jobs: | |
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.7' | ||
python-version: '3.8' | ||
|
||
- name: Install dependencies | ||
run: | | ||
. ci/common | ||
setup_helm | ||
KUBEVAL_VERSION=0.15.0 setup_kubeval | ||
pip install chartpress yamllint | ||
- uses: pre-commit/[email protected] | ||
|
||
- name: Lint and validate | ||
# NOTE: Kubernetes resource validation can only be done against | ||
# Kubernetes versions with schemas available in: | ||
# https://github.com/instrumenta/kubernetes-json-schema | ||
# | ||
# NOTE: The "helm template" command will evaluate | ||
# .Capabilities.APIVersion.Has in templates based on a Kubernetes | ||
# version associated with the helm binary's version. Since we | ||
# render the templates with a specific helm version, we end up | ||
# rendering templates using a mocked k8s version unrelated to the | ||
# Kubernetes version we want to validate against. This issue has | ||
# made us not validate against versions lower than 1.14. | ||
run: tools/templates/lint-and-validate.py --kubernetes-versions 1.14.0,1.18.0 | ||
run: tools/templates/lint-and-validate.py | ||
|
||
|
||
test: | ||
|
@@ -140,6 +128,10 @@ jobs: | |
. ./ci/common | ||
install_and_run_chartpress_and_pebble | ||
- name: "Helm template --validate (with lint and validate config)" | ||
run: | | ||
helm template --validate jupyterhub ./jupyterhub --values tools/templates/lint-and-validate-values.yaml | ||
- name: "Install ${{ matrix.upgrade-from }} chart" | ||
if: matrix.test == 'upgrade' | ||
run: | | ||
|
@@ -167,7 +159,7 @@ jobs: | |
await_autohttps_tls_cert_acquisition | ||
await_autohttps_tls_cert_save | ||
- name: "Upgrade ${{ matrix.upgrade-from }} chart to current chart" | ||
- name: "Install or upgrade to current chart" | ||
run: | | ||
. ./ci/common | ||
helm upgrade --install jupyterhub ./jupyterhub --values dev-config.yaml | ||
|
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