Last active
October 4, 2022 01:29
-
-
Save orimanabu/e7d400f55529ac98f128e3ecb57ffdca to your computer and use it in GitHub Desktop.
Determine what version of an RPM is included in an OCP release
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 | |
# https://github.com/openshift/os/blob/master/docs/faq.md#q-how-do-i-determine-what-version-of-an-rpm-is-included-in-an-rhcos-release | |
export REGISTRY_AUTH_FILE=~/.config/containers/auth.json | |
if [ x"$#" != x"2" ]; then | |
echo "$0 ocp_version package_name" | |
exit 1 | |
fi | |
ocp_version=$1; shift | |
package=$1; shift | |
coreos_version=$(oc image info $(oc adm release info --image-for=machine-os-content quay.io/openshift-release-dev/ocp-release:${ocp_version}-x86_64) | awk '/^ *version/ {split($0,a,"="); print a[2]}') | |
curl -s https://releases-rhcos-art.apps.ocp-virt.prod.psi.redhat.com/storage/releases/rhcos-${ocp_version%*.*}/${coreos_version}/x86_64/commitmeta.json | jq '."rpmostree.rpmdb.pkglist"[] | select(.[0] == "'${package}'")' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment