Skip to content

Commit

Permalink
[Airgap] Fix script to support Dev and Staging
Browse files Browse the repository at this point in the history
Newer versions of Dev and Staging now need to be explicitly allowed to
be pull with Helm.

Signed-off-by: Loic Devulder <ldevulder@suse.com>
  • Loading branch information
ldevulder committed Sep 30, 2024
1 parent 3df501d commit 5702286
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/elemental-airgap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -286,17 +286,21 @@ fetch_charts() {
for c in $charts; do
local chart=""
local chart_ver=""
local opts=""

# helm pull only supports semver tags: for the "latest" tag just don't put the version.
[[ "$CHART_VERSION" != "latest" ]] && chart_ver="--version $CHART_VERSION"

# helm pull needs to be aware of development versions
[[ "${CHART_NAME_OPERATOR}" =~ (Dev|dev|DEV|Staging|staging|STAGING) ]] && opts="--devel"

# 'c' var holds the name (e.g., CHART_NAME_OPERATOR),
# 'chart' var holds the value (e.g., elemental-operator-chart-1.4.tgz)
eval chart=\$$c
case $chart in
"oci://"*|"https//"*)
log_debug "fetching chart '$chart' $chart_ver"
if ! outstr=$(helm pull ${chart} $chart_ver 2>&1); then
if ! outstr=$(helm pull ${opts} ${chart} $chart_ver 2>&1); then
exit_error "downloading ${chart}:\n $outstr"
fi
eval $c=$(ls -t1 | head -n 1)
Expand Down

0 comments on commit 5702286

Please sign in to comment.