Created
April 19, 2023 09:53
-
-
Save jgato/36a2ac285534895fe047980a263e1aa7 to your computer and use it in GitHub Desktop.
Get the RHCOS version for each OCP version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$CHANNEL" ] | |
then | |
echo Provide the channel via \'export CHANNEL=stable-4.x\' | |
exit 1 | |
fi | |
rm -f version_maps &> /dev/null | |
VERSIONS=$(curl -sH 'Accept: application/json' "https://api.openshift.com/api/upgrades_info/v1/graph?channel=${CHANNEL}" | jq '.nodes[].version' -r) | |
for VERSION in ${VERSIONS} | |
do | |
RHCOSVERSION="$(oc adm release info "${VERSION}" -o 'jsonpath={.displayVersions.machine-os.Version}')" | |
echo "$VERSION - $RHCOSVERSION" | tee -a ./version_maps | |
done | |
echo OpenShift to RHCOS version mapping is in 'version_map |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment