Skip to content

Commit 48fab8c

Browse files
committed
Fix configure-vm cross-major version logic
1 parent 5d4fb17 commit 48fab8c

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

scripts/devenv-builder/configure-vm.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,18 +218,19 @@ function configure_rhel_repositories() {
218218
sudo subscription-manager repos --enable "rhocp-${ocp_major}.${RHOCP}-for-rhel-9-$(uname -m)-rpms"
219219
elif [[ "${RHOCP}" =~ ^http ]]; then
220220
url=$(echo "${RHOCP}" | cut -d, -f1)
221-
ver=$(echo "${RHOCP}" | cut -d, -f2)
222-
OCP_REPO_NAME="rhocp-${ocp_major}.${ver}-for-rhel-9-mirrorbeta-$(uname -i)-rpms"
221+
major=$(echo "${RHOCP}" | cut -d, -f2)
222+
ver=$(echo "${RHOCP}" | cut -d, -f3)
223+
OCP_REPO_NAME="rhocp-${major}.${ver}-for-rhel-9-mirrorbeta-$(uname -i)-rpms"
223224
sudo tee "/etc/yum.repos.d/${OCP_REPO_NAME}.repo" >/dev/null <<EOF
224225
[${OCP_REPO_NAME}]
225-
name=Beta rhocp-${ocp_major}.${ver} RPMs for RHEL 9
226+
name=Beta rhocp-${major}.${ver} RPMs for RHEL 9
226227
baseurl=${url}
227228
enabled=1
228229
gpgcheck=0
229230
skip_if_unavailable=0
230231
EOF
231232
# Calculate Y-1 version
232-
get_prev_version "${ocp_major}" "${ver}"
233+
get_prev_version "${major}" "${ver}"
233234
if [[ -n "${prev_minor}" ]]; then
234235
PREVIOUS_RHOCP=$("${RHOCP_REPO}" "${prev_minor}" "${prev_major}")
235236
if [[ "${PREVIOUS_RHOCP}" =~ ^[0-9]{1,2}$ ]]; then

scripts/get-latest-rhocp-repo.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
#
1515
# Output is:
1616
# - just a minor version in case of subscription RHOCP repository, e.g.: 15
17-
# - or an URL to beta mirror followed by comma and minor version, e.g.:
18-
# https://mirror.openshift.com/pub/openshift-v4/x86_64/dependencies/rpms/4.16-el9-beta/,16
19-
# https://mirror.openshift.com/pub/openshift-v5/x86_64/dependencies/rpms/5.0-el9-beta/,0
17+
# - or an URL to beta mirror followed by comma, major, comma, and minor version, e.g.:
18+
# https://mirror.openshift.com/pub/openshift-v4/x86_64/dependencies/rpms/4.16-el9-beta/,4,16
19+
# https://mirror.openshift.com/pub/openshift-v5/x86_64/dependencies/rpms/5.0-el9-beta/,5,0
2020

2121
set -euo pipefail
2222

@@ -88,7 +88,7 @@ for (( step=0; step < max_steps; step++ )); do
8888

8989
rhocp_beta_url="https://mirror.openshift.com/pub/openshift-v${check_major}/$(uname -m)/dependencies/rpms/${check_major}.${check_minor}-el9-beta/"
9090
if sudo dnf repository-packages --showduplicates --disablerepo '*' --repofrompath "this,${rhocp_beta_url}" this info cri-o 1>&2; then
91-
echo "${rhocp_beta_url},${check_minor}"
91+
echo "${rhocp_beta_url},${check_major},${check_minor}"
9292
exit 0
9393
fi
9494

0 commit comments

Comments
 (0)