[AI Generated] BugFix: fix CentOS 7/8 yum repo init by scoping vault rewrite and disabling OpenLogic repo#4439
Open
[AI Generated] BugFix: fix CentOS 7/8 yum repo init by scoping vault rewrite and disabling OpenLogic repo#4439
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates CentOS 7/8 yum repository initialization in CentOs._initialize_package_installation to better handle EOL mirror changes and broken OpenLogic-hosted repos, aiming to make package operations succeed on Azure marketplace CentOS images.
Changes:
- Scope
olcentgbl.trafficmanager.net→vault.centos.orgrewrites to only/centos/and/$contentdir/paths. - Disable
OpenLogic*.repoby renaming matching repo files so yum won’t try unreachable/openlogic/...baseurls. - Apply
skip_if_unavailable=trueglobally and per failed repo extracted fromyum repolist -voutput.
✅ AI Test Selection — PASSED1 test case(s) selected (view run) Marketplace image: redhat rhel 9_5 latest
Test case details
|
694dd43 to
04a70ef
Compare
…rewrite and disabling OpenLogic repo
CentOS 7/8 marketplace images on Azure ship with two issues that
break package installation now that mirror.centos.org is gone:
1. Some images carry an OpenLogic.repo whose baseurl points at
olcentgbl.trafficmanager.net/openlogic/... — a path that has no
vault.centos.org equivalent. A blanket host rewrite from
olcentgbl.trafficmanager.net to vault.centos.org turns the DNS
error into a 404 but still breaks yum.
2. The stock CentOS repo files set skip_if_unavailable=False per
repo, which overrides any global value set on [main]. So even
with skip_if_unavailable=true on [main], a single failing repo
still blocks the whole `yum install`.
Fix:
* Restrict the olcentgbl -> vault.centos.org rewrite to the
`/centos/` (CentOS 7) and `/$contentdir/` (CentOS 8) path
components, where vault.centos.org actually mirrors the tree.
Other paths are left alone.
* Disable any OpenLogic*.repo by renaming it to
OpenLogic*.repo.disabled (case-insensitive glob; filename casing
varies across images).
* Use plain (BRE) sed with literal strings; extended regex with
alternation and "\$contentdir" inside a single-quoted "sh -c"
argument has been observed to silently no-op on some images.
* Parse `yum repolist -v` output for "failure: <repodata> from
<repoid>:" and apply skip_if_unavailable=true to each failing
repo individually so per-repo settings cannot override us.
Validated on Azure marketplace images:
* OpenLogic CentOS 7_7-gen2 7.7.20200213 — yum install kexec-tools
succeeded ("installed successfully")
* OpenLogic CentOS 7_9 7.9.2022101800 — VM provisioning + repo
init clean
* OpenLogic CentOS 8_3 8.3.2020120900 — VM provisioning + repo
init clean
04a70ef to
1c41ae9
Compare
|
| Count | |
|---|---|
| ✅ Passed | 0 |
| ❌ Failed | 0 |
| ⏭️ Skipped | 0 |
| Total | 0 |
Test case details
| Test Case | Status | Time (s) | Message |
|---|
✅ AI Test Selection — PASSED1 test case(s) selected (view run) Marketplace image: redhat rhel 9_5 latest
Test case details
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix CentOS 7/8 marketplace image yum repo initialization. Restrict the
olcentgbl.trafficmanager.net→vault.centos.orgrewrite to/centos/and/$contentdir/paths only (where the vault actually mirrors), disable anyOpenLogic*.repo(whose/openlogic/...baseurl has novault.centos.orgequivalent), and applyskip_if_unavailable=trueper failed repo so the per-repoFalsein stock CentOS repo files cannot override it.Validation Results