File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,9 +41,15 @@ chart_response=$(curl -fsSL \
4141 exit 1
4242}
4343
44- latest_chart=$( printf ' %s' " $chart_response " \
45- | jq -r ' .[] | select(.type == "dir") | .name' \
46- | sort -V | tail -1)
44+ # Prefer a final (non-pre-release) chart over an RC: sort -V ranks "0.14.4-rc.5"
45+ # above "0.14.4" because the RC has extra characters, so without filtering the
46+ # RC would be selected even after the final chart has been published.
47+ all_charts=$( printf ' %s' " $chart_response " \
48+ | jq -r ' .[] | select(.type == "dir") | .name' )
49+ latest_chart=$( printf ' %s' " $all_charts " | { grep -v ' +up.*-' || true ; } | sort -V | tail -1)
50+ if [ -z " $latest_chart " ]; then
51+ latest_chart=$( printf ' %s' " $all_charts " | sort -V | tail -1)
52+ fi
4753
4854if [ -z " $latest_chart " ]; then
4955 printf ' ERROR: No Fleet chart directories found in rancher/charts branch %s\n' " $charts_branch " >&2
You can’t perform that action at this time.
0 commit comments