diff --git a/scripts/devenv-builder/configure-vm.sh b/scripts/devenv-builder/configure-vm.sh index 493c14861a..5f162bbf40 100755 --- a/scripts/devenv-builder/configure-vm.sh +++ b/scripts/devenv-builder/configure-vm.sh @@ -193,9 +193,6 @@ function configure_rhel_subscription() { function configure_rhel_repositories() { sudo subscription-manager config --rhsm.manage_repos=1 - # Extract major version from Makefile.version - local -r ocp_major="$(grep '^OCP_VERSION' "${MAKE_VERSION}" | cut -d'=' -f2 | tr -d ' ' | cut -d'.' -f1)" - # Map of last minor version for each major (for cross-major transitions) local -A last_minor_for_major=([4]=22) @@ -214,34 +211,35 @@ function configure_rhel_repositories() { } RHOCP=$("${RHOCP_REPO}") - if [[ "${RHOCP}" =~ ^[0-9]{1,2}$ ]]; then - sudo subscription-manager repos --enable "rhocp-${ocp_major}.${RHOCP}-for-rhel-9-$(uname -m)-rpms" + if [[ "${RHOCP}" =~ ^[0-9]+\.[0-9]+$ ]]; then + sudo subscription-manager repos --enable "rhocp-${RHOCP}-for-rhel-9-$(uname -m)-rpms" elif [[ "${RHOCP}" =~ ^http ]]; then url=$(echo "${RHOCP}" | cut -d, -f1) - major=$(echo "${RHOCP}" | cut -d, -f2) - ver=$(echo "${RHOCP}" | cut -d, -f3) - OCP_REPO_NAME="rhocp-${major}.${ver}-for-rhel-9-mirrorbeta-$(uname -i)-rpms" + ver=$(echo "${RHOCP}" | cut -d, -f2) + OCP_REPO_NAME="rhocp-${ver}-for-rhel-9-mirrorbeta-$(uname -m)-rpms" sudo tee "/etc/yum.repos.d/${OCP_REPO_NAME}.repo" >/dev/null <&2; then - echo "${check_minor}" + echo "${check_major}.${check_minor}" exit 0 fi rhocp_beta_url="https://mirror.openshift.com/pub/openshift-v${check_major}/$(uname -m)/dependencies/rpms/${check_major}.${check_minor}-el9-beta/" if sudo dnf repository-packages --showduplicates --disablerepo '*' --repofrompath "this,${rhocp_beta_url}" this info cri-o 1>&2; then - echo "${rhocp_beta_url},${check_major},${check_minor}" + echo "${rhocp_beta_url},${check_major}.${check_minor}" exit 0 fi