File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed
Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change 1+ images.txt
2+
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -euo pipefail
33
4- if ! command -v yq > /dev/null || ! yq --version | grep -q ' v4.' 2>&1 ; then
5- echo " Error: yq 4.x is required: https://mikefarah.gitbook.io/yq#install" >&2
6- yq --version
7- exit 1
8- fi
9-
10- CHART_PATH=" ${1:- .} "
4+ CHART_PATH=$( realpath " ${1:- .} " )
115OUTPUT_FILE=" ${2:- images.txt} "
126
137TMP_VALUES=$( mktemp)
148TMP_IMAGES=$( mktemp)
159trap ' rm -f "$TMP_VALUES" "$TMP_IMAGES"' EXIT
1610
11+ # Check if yq 4.x is available locally, otherwise use Docker
12+ if ! command -v yq > /dev/null || ! yq --version 2>&1 | grep -q ' v4\.' ; then
13+ echo " yq 4.x not found locally, using Docker image mikefarah/yq:4" >&2
14+ yq () {
15+ docker run --rm -i \
16+ -u " $( id -u) " \
17+ -v " ${CHART_PATH} :${CHART_PATH} " \
18+ -v " /tmp:/tmp" \
19+ -w " ${PWD} " \
20+ mikefarah/yq:4 " $@ "
21+ }
22+ fi
23+
1724# Enable all components to ensure everything renders and we find all images
1825yq '
1926 (.. | select(has("enabled")).enabled) = true
You can’t perform that action at this time.
0 commit comments