Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(operator installation): fix OCP version detection on clusterbot rosa; throw error when umoci is not installed, with installation call to action (RHIDP-5108) #490

Merged
merged 1 commit into from
Nov 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .rhdh/scripts/install-rhdh-catalog-source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ fi

# log into your OCP cluster before running this or you'll get null values for OCP vars!
OCP_VER="v$(oc version -o json | jq -r '.openshiftVersion' | sed -r -e "s#([0-9]+\.[0-9]+)\..+#\1#")"
if [[ $OCP_VER == "vnull" ]]; then # try releaseClientVersion = 4.16.14
OCP_VER="v$(oc version -o json | jq -r '.releaseClientVersion' | sed -r -e "s#([0-9]+\.[0-9]+)\..+#\1#")"
fi
OCP_ARCH="$(oc version -o json | jq -r '.serverVersion.platform' | sed -r -e "s#linux/##")"
if [[ $OCP_ARCH == "amd64" ]]; then OCP_ARCH="x86_64"; fi
# if logged in, this should return something like latest-v4.12-x86_64
Expand Down Expand Up @@ -225,11 +228,6 @@ function install_hosted_control_plane_cluster() {
# to the underlying nodes, causing an issue mirroring internal images effectively.
# This function works around this by locally modifying the bundles (replacing all refs to the internal registries
# with their mirrors on quay.io), rebuilding and pushing the images to the internal cluster registry.
if [[ ! $(command -v umoci) ]]; then
errorf "Please install umoci 0.4+. See https://github.com/opencontainers/umoci"
exit 1
fi

mkdir -p "${TMPDIR}/rhdh/rhdh" >&2
echo "[DEBUG] Rendering IIB $UPSTREAM_IIB as a local file..." >&2
opm render "$UPSTREAM_IIB" --output=yaml > "${TMPDIR}/rhdh/rhdh/render.yaml"
Expand Down Expand Up @@ -352,6 +350,10 @@ fi
newIIBImage=${IIB_IMAGE}
if [[ "${IS_HOSTED_CONTROL_PLANE}" = "true" ]]; then
echo "[INFO] Detected a cluster with a hosted control plane"
if [[ ! $(command -v umoci) ]]; then
errorf "Please install umoci 0.4+. See https://github.com/opencontainers/umoci?tab=readme-ov-file#install"
exit 1
fi
newIIBImage=$(install_hosted_control_plane_cluster)
else
newIIBImage=$(install_regular_cluster)
Expand Down
Loading