Skip to content

Instantly share code, notes, and snippets.

@zackbradys
Last active February 24, 2024 01:31
Show Gist options
  • Save zackbradys/a2335e93eb455715f460aa22dc83ec7f to your computer and use it in GitHub Desktop.
Save zackbradys/a2335e93eb455715f460aa22dc83ec7f to your computer and use it in GitHub Desktop.
#!/bin/bash
for app in rke2; do
output=$(curl -ks "https://update.${app}.io/v1-release/channels" | jq --arg app "${app}" -r '.data[]|select(.id==("stable","latest","testing"))|[$app, .name, .latest]|@tsv')
[ -n "$output" ] && echo "$output"
done && echo
for app in k3s; do
output=$(curl -ks "https://update.${app}.io/v1-release/channels" | jq --arg app "${app}" -r '.data[]|select(.id==("stable","latest","testing"))|[$app, .name, .latest]|@tsv')
[ -n "$output" ] && echo "$output"
done && echo
for i in stable latest alpha; do
output=$(curl -s https://releases.rancher.com/server-charts/${i}/index.yaml | json_xs -f yaml -t json | jq --arg app ${i} -r '.entries.rancher[0]|[.name, $app, .version]|@tsv')
[ -n "$output" ] && echo "$output"
done && echo
output=$(curl -s https://api.github.com/repos/harvester/harvester/releases/latest | grep '"tag_name":' | sed 's/.*"v\([^"]*\)".*/\1/')
[ -n "$output" ] && echo -e "harvester stable $output" && echo
output=$(curl -s https://charts.longhorn.io/index.yaml | json_xs -f yaml -t json | jq -r '.entries.longhorn[0]|["longhorn", "stable", .version]|@tsv')
[ -n "$output" ] && echo "$output" && echo
output=$(curl -s https://neuvector.github.io/neuvector-helm/index.yaml | json_xs -f yaml -t json | jq -r '.entries.core[0]|["neuvector", "stable", .version]|@tsv')
[ -n "$output" ] && echo "$output" && echo
@zackbradys
Copy link
Author

zackbradys commented Jan 29, 2024

example use of the script:

curl -sfl https://gist.githubusercontent.com/zackbradys/a2335e93eb455715f460aa22dc83ec7f/raw/4d6196eee0b3b4db35a4e63a8aee83da652f17bf/rke2-version-check.sh | bash

example output:

rke2    stable  v1.26.12+rke2r1
rke2    latest  v1.29.0+rke2r1
rke2    testing v1.29.1-rc2+rke2r1

k3s     stable  v1.28.5+k3s1
k3s     latest  v1.29.0+k3s1
k3s     testing v1.29.1-rc2+k3s1

rancher stable  2.7.9
rancher latest  2.8.1
rancher alpha   2.8.0-alpha2

harvester       stable  1.2.1

longhorn        stable  1.5.3

neuvector       stable  2.7.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment