-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
task: move from kubeval to kubeconform (#73)
In the process I also spotted that we're not actually linting/validating all our schemas, since we run helm template without any values, it's run without ingress and hpa enabled, so this PR also adds values files which causes all template files to be exercised.
- Loading branch information
Christopher Kolstad
authored
Mar 17, 2023
1 parent
2eb76ca
commit 573f4f0
Showing
19 changed files
with
181 additions
and
94 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
autoscaling: | ||
enabled: true | ||
minReplicas: 1 | ||
maxReplicas: 4 | ||
|
||
ingress: | ||
enabled: true |
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,27 @@ | ||
#!/bin/bash | ||
# | ||
# use kubeconform to validate helm generated kubernetes manifests | ||
# | ||
|
||
set -o errexit | ||
set -o pipefail | ||
|
||
echo "Running for K8S schema version: $KUBERNETES_VERSION with Kube conform: $KUBECONFORM_VERSION" | ||
# install kubeconform | ||
curl --silent --show-error --fail --location --output /tmp/kubeconform.tar.gz https://github.com/yannh/kubeconform/releases/download/"${KUBECONFORM_VERSION}"/kubeconform-linux-amd64.tar.gz | ||
sudo tar -C /usr/local/bin -xf /tmp/kubeconform.tar.gz kubeconform | ||
|
||
mkdir -p results | ||
echo "Adding bitnami repo so dependency building succeeds" | ||
helm repo add bitnami https://charts.bitnami.com/bitnami | ||
echo "Repo added" | ||
CHART_DIRS="$(git diff --find-renames --name-only "$(git rev-parse --abbrev-ref HEAD)" remotes/origin/main -- charts | grep '[cC]hart.yaml' | sed -e 's#/[Cc]hart.yaml##g')" | ||
for CHART_DIR in ${CHART_DIRS}; do | ||
echo "helm dependency build..." | ||
helm dependency build "${CHART_DIR}" | ||
|
||
echo "kubeconforming ${CHART_DIR##charts/} chart ..." | ||
helm template "${CHART_DIR}" -f ./"${CHART_DIR}"/ci/"${CHART_DIR##charts/}"-values.yaml | kubeconform -kubernetes-version "${KUBERNETES_VERSION}" --output=tap > results/"${CHART_DIR##charts/}"-"${KUBERNETES_VERSION}"-result.tap | ||
done | ||
|
||
exit 0 |
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
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 |
---|---|---|
|
@@ -10,23 +10,22 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Fetch history | ||
run: git fetch --prune --unshallow | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Configure Git | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
- name: Install Helm | ||
uses: azure/setup-helm@v1 | ||
uses: azure/setup-helm@v3 | ||
with: | ||
version: v3.5.2 | ||
version: 3.11.1 | ||
|
||
- name: Run chart-releaser | ||
uses: helm/chart-releaser-action@v1.2.0 | ||
uses: helm/chart-releaser-action@v1.5.0 | ||
with: | ||
charts_repo_url: https://docs.getunleash.io/helm-charts | ||
env: | ||
|
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
ingress: | ||
enabled: true | ||
|
||
autoscaling: | ||
enabled: true | ||
minReplicas: 1 | ||
maxReplicas: 4 | ||
|
||
edge: | ||
enable: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
{{- if .Values.edge.enable }} | ||
kind: ConfigMap | ||
apiVersion: v1 | ||
metadata: | ||
name: edge-features | ||
data: | ||
features.json: |- | ||
{{ .Files.Get "features.json" | indent 4}} | ||
{{- end}} |
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
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
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
ingress: | ||
enabled: true | ||
|
||
autoscaling: | ||
enabled: true | ||
minReplicas: 1 | ||
maxReplicas: 4 |
Oops, something went wrong.