Skip to content

Commit

Permalink
replace kubeval with kubeconform (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
helderjs authored Dec 5, 2022
1 parent d2a693c commit 057d032
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
24 changes: 24 additions & 0 deletions .github/kubeconform.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
set -uxo pipefail

# forked
git remote add mongo https://github.com/mongodb/helm-charts.git
git fetch mongo

CHART_DIRS="$(git diff --find-renames --name-only "$(git rev-parse --abbrev-ref HEAD)" mongo/add-role -- charts | grep -i chart.yaml | xargs -r dirname)"
KUBECONFORM_VERSION="v0.5.0"
SCHEMA_LOCATION="https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/"

# 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"
tar -xf /tmp/kubeconform.tar.gz kubeconform

# validate charts
helm repo add mongodb https://mongodb.github.io/helm-charts
for CHART_DIR in ${CHART_DIRS}; do
if [[ ! -d "$CHART_DIR" ]]; then
continue
fi
helm dependency update "${CHART_DIR}"
helm template "${CHART_DIR}" | ./kubeconform --strict --ignore-missing-schemas --kubernetes-version "${KUBERNETES_VERSION#v}" --schema-location "${SCHEMA_LOCATION}"
done
24 changes: 0 additions & 24 deletions .github/kubeval.sh

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Run chart-testing (lint)
run: ct lint --config .github/ct.yaml

kubeval-chart:
kubeconform-chart:
runs-on: ubuntu-latest
needs:
- lint-chart
Expand All @@ -55,7 +55,7 @@ jobs:
.github/dependency_as_file.sh atlas-operator-crds atlas-operator
.github/dependency_as_file.sh community-operator-crds community-operator
- name: Run kubeval
- name: Run kubeconform
env:
KUBERNETES_VERSION: ${{ matrix.k8s }}
run: .github/kubeval.sh
run: .github/kubeconform.sh

0 comments on commit 057d032

Please sign in to comment.