From ec236e97626ed00cdde9f19a8366e508256ebfc7 Mon Sep 17 00:00:00 2001 From: kfox1111 Date: Mon, 3 Apr 2023 10:50:06 -0700 Subject: [PATCH] Test for configurable images (#182) Co-authored-by: Marco Franssen Signed-off-by: Marco Franssen --- .github/workflows/helm-chart-ci.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/helm-chart-ci.yaml b/.github/workflows/helm-chart-ci.yaml index c55fd18..256506e 100644 --- a/.github/workflows/helm-chart-ci.yaml +++ b/.github/workflows/helm-chart-ci.yaml @@ -49,6 +49,25 @@ jobs: fi done + - name: Check objects for images without overrides + run: | + set +e + set -o pipefail + # Look for image: definitions that are not templated. If we find none, exit is not 0 and we invert the error code to get the + # test to pass. Ignore tests for now... + grep "image:" charts/spire/charts/*/templates/*.* | grep -v 'image: {{ template "' > /tmp/findings + res=$? + if [ $res -eq 0 ]; then + { + echo "## Hardcoded images" + echo + echo ":x: These templates were found to be using statically defined images and not overridable ones. Please fix." + echo + cat /tmp/findings + } >> "$GITHUB_STEP_SUMMARY" + exit 1 + fi + lint-chart: runs-on: ubuntu-22.04