k3s: skip pre-releases in update script

This commit is contained in:
superherointj 2024-04-26 17:34:51 -03:00
parent 0b868df4ce
commit 9ca7c0dd16

View file

@ -19,7 +19,9 @@ LATEST_TAG_RAWFILE=${WORKDIR}/latest_tag.json
curl --silent -f ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
https://api.github.com/repos/k3s-io/k3s/releases > ${LATEST_TAG_RAWFILE}
LATEST_TAG_NAME=$(jq 'map(.tag_name)' ${LATEST_TAG_RAWFILE} | \
LATEST_TAG_NAME=$(cat ${LATEST_TAG_RAWFILE} | \
jq -r 'map(select(.prerelease == false))' | \
jq 'map(.tag_name)' | \
grep -v -e rc -e engine | tail -n +2 | head -n -1 | sed 's|[", ]||g' | sort -rV | grep -E "^v1\.${MINOR_VERSION}\." | head -n1)
K3S_VERSION=$(echo ${LATEST_TAG_NAME} | sed 's/^v//')