Skip to content

fix: treat releasever <=7 x.y as xServer - #140

Closed
pindo696 wants to merge 1 commit into
RedHatInsights:mainfrom
pindo696:7.9-and-7Server-yum-adapation
Closed

pindo696 wants to merge 1 commit into
RedHatInsights:mainfrom
pindo696:7.9-and-7Server-yum-adapation

Conversation

@pindo696

Copy link
Copy Markdown

Reproduced on a RHEL 7.9 VM: yum repolist looked the same for 7.9 and after subscription-manager release --set=7Server (and checking redhat.repo). Vulnerability report did not. With rhsm_version=7.9 we got different number of CVEs reported. Same host, different releasever only.

That’s because vmaas filters repos by releasever. So 7.9 and 7Server hit different repo sets - which is intentional as strict matching and caused by setting subscription-manager release --set=7.9 which is a user preference setup.
RHEL 7 has the dual 7.9 and 7Server naming that looks like that yum treats as equivalent. This hotfix does the same in vmaas-lib: alias {x}.{y} -> {x}Server before matching. We don’t see this on RHEL 8+ since releasevers are numeric and already match what is being stored (RHEL 8+ uses {major}.{minor}.)

I was unable to reproduce on RHEL 6 as it was unable to register the machine with entitlement server.

TLDR: Alias {x}.{y} -> {x}Server for x <= 7 before existing releasever matching in vmaas-lib (passReleasever / repos2IDs).

Alias x.y to xServer for rhel major versions <=7 when matching repos so rhel repolist is closer to yum. RHINENG-26908
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.84%. Comparing base (b64c496) to head (cc88d2e).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
vmaas/vulnerabilities.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #140      +/-   ##
==========================================
+ Coverage   70.72%   70.84%   +0.12%     
==========================================
  Files          30       30              
  Lines        2842     2854      +12     
==========================================
+ Hits         2010     2022      +12     
  Misses        722      722              
  Partials      110      110              
Flag Coverage Δ
unittests 70.84% <86.66%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants