Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix /etc/redhat-release file parsing when resolving distro details #3688

Merged
merged 2 commits into from
Feb 26, 2025

Conversation

wagoodman
Copy link
Contributor

@wagoodman wagoodman commented Feb 25, 2025

Description

It seems that parsing /etc/redhat-release files results in the wrong values in some cases:

$ syft localhost/testimage:latest -o json | jq '.distro'
{
  "prettyName": "Red Hat Enterprise Linux",
  "name": "red hat enterprise linux",
  "id": "red hat enterprise linux",
  "idLike": [
    "red hat enterprise linux"
  ],
  "version": "8.10",
  "versionID": "8.10"
}

This PR adjusts the values to be more inline with expected values:

{
  "prettyName": "Red Hat Enterprise Linux release 8.10 (Ootpa)",
  "name": "Red Hat Enterprise Linux",
  "id": "rhel",
  "idLike": [
    "rhel"
  ],
  "version": "8.10 (Ootpa)",
  "versionID": "8.10"
}

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have added unit tests that cover changed behavior
  • I have tested my code in common scenarios and confirmed there are no regressions
  • I have added comments to my code, particularly in hard-to-understand sections

Sorry, something went wrong.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman added the bug Something isn't working label Feb 25, 2025
@wagoodman wagoodman requested a review from a team February 25, 2025 23:02
@wagoodman wagoodman self-assigned this Feb 25, 2025
@wagoodman wagoodman changed the title Fix redhat release file parsing Fix /etc/redhat-release file parsing when resolving distro details Feb 25, 2025
@wagoodman wagoodman enabled auto-merge (squash) February 26, 2025 01:33
fix test
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman merged commit 5e27231 into main Feb 26, 2025
12 checks passed
@wagoodman wagoodman deleted the fix-rhel-release-parsing branch February 26, 2025 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants