From 239f494a2b7ad1d9dec070bb5d67a8ec1bf5b5f5 Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Fri, 11 Aug 2023 11:46:59 +0200 Subject: [PATCH] ipi-install: avoid failing step on OSUS config corner cases --- .../install/ipi-install-install-commands.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ci-operator/step-registry/ipi/install/install/ipi-install-install-commands.sh b/ci-operator/step-registry/ipi/install/install/ipi-install-install-commands.sh index 1965a37418fd0..97ac6f8b3ac6b 100755 --- a/ci-operator/step-registry/ipi/install/install/ipi-install-install-commands.sh +++ b/ci-operator/step-registry/ipi/install/install/ipi-install-install-commands.sh @@ -9,6 +9,11 @@ function set-cluster-version-spec-update-service() { payload_version="$(oc adm release info "${OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE}" -o "jsonpath={.metadata.version}")" echo "Release payload version: ${payload_version}" + if [[ ! -f ${dir}/manifests/cvo-overrides.yaml ]]; then + echo "No CVO overrides file found, will not configure OpenShift Update Service" + return + fi + # Using OSUS in upgrade jobs would be tricky (we would need to know the channel with both versions) # and the use case has little benefits (not many jobs that update between two released versions) # so we do not need to support it. We still need to channel clear to avoid tripping the @@ -41,10 +46,16 @@ function set-cluster-version-spec-update-service() { payload_arch_param="" fi + + local channel + if ! channel="$(grep -E --only-matching '(stable|eus|fast|candidate)-4.[0-9]+' "${dir}/manifests/cvo-overrides.yaml")"; then + echo "No known OCP channel found in CVO manifest, clearing the channel" + sed -i '/^ channel:/d' "${dir}/manifests/cvo-overrides.yaml" + return + fi + # The candidate channel is most likely to contain the versions we are interested in, so transfer the current channel # into a candidate one. - local channel - channel="$(grep -E --only-matching '(stable|eus|fast|candidate)-4.[0-9]+' "${dir}/manifests/cvo-overrides.yaml")" echo "Original channel from CVO manifest: ${channel}" local candidate_channel candidate_channel="$(echo "${channel}" | sed -E 's/(stable|eus|fast)/candidate/')"