Skip to content

Instantly share code, notes, and snippets.

@orimanabu
Last active October 4, 2022 01:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orimanabu/e7d400f55529ac98f128e3ecb57ffdca to your computer and use it in GitHub Desktop.
Save orimanabu/e7d400f55529ac98f128e3ecb57ffdca to your computer and use it in GitHub Desktop.
Determine what version of an RPM is included in an OCP release
#!/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