feat(get-images-from-files): add support for helm values (#29)
CD / Release (push) Successful in 13s
CD / Release (push) Successful in 13s
Adding support for images inside of helm value files as per helm convention. Limitation: Default images the chart may propose are not exposed and therefore not supported, only what's specifically mentioned in the values file. Reviewed-on: t.behrendt/trivy-actions#29 Reviewed-by: branch-buddy <branch-buddy@t00n.de> Co-authored-by: t.behrendt <t.behrendt@t00n.de> Co-committed-by: t.behrendt <t.behrendt@t00n.de>
This commit was merged in pull request #29.
This commit is contained in:
@@ -45,6 +45,7 @@ jobs:
|
||||
- get-images-from-files/test.Dockerfile
|
||||
- get-images-from-files/test-deployment.yaml
|
||||
- get-images-from-files/test-compose.yaml
|
||||
- get-images-from-files/test-values-helmfile.yaml
|
||||
- name: Check image formats extracted
|
||||
run: |
|
||||
images="${{ steps.giff.outputs.images }}"
|
||||
@@ -64,6 +65,11 @@ jobs:
|
||||
check "Compose registry+tag (web:v3)" "example.com/compose/web:v3"
|
||||
check "Compose registry+tag (worker:v3)" "example.com/compose/worker:v3"
|
||||
|
||||
# Helmfile values (repository + tag, optional registry)
|
||||
check "Helmfile image (repository+tag)" "example.com/helmfile/app:v4"
|
||||
check "Helmfile images.worker (repository+tag)" "example.com/helmfile/worker:v5"
|
||||
check "Helmfile images.helper (repository+tag with digest)" "example.com/myproject/helper:2.0@sha256:cccc"
|
||||
|
||||
# Shared ref (in both files) — must appear exactly once
|
||||
check "Shared ref present (distroless/static:nonroot)" "example.com/distroless/static:nonroot"
|
||||
count=$(echo "$images" | tr ',' '\n' | grep -c 'example.com/distroless/static:nonroot' || true)
|
||||
@@ -71,7 +77,7 @@ jobs:
|
||||
[ "$count" -eq 1 ] && echo "OK (count=$count)" || { echo "FAIL (count=$count, expected 1)"; exit 1; }
|
||||
total=$(echo "$images" | tr ',' '\n' | grep -c . || true)
|
||||
echo -n " Total unique refs: "
|
||||
[ "$total" -eq 7 ] && echo "OK ($total)" || { echo "FAIL (got $total, expected 7)"; exit 1; }
|
||||
[ "$total" -eq 10 ] && echo "OK ($total)" || { echo "FAIL (got $total, expected 10)"; exit 1; }
|
||||
|
||||
echo ""
|
||||
echo "All checks passed."
|
||||
|
||||
Reference in New Issue
Block a user