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

Add ReadOSReleaseFromTree (HMS-3783) #575

Merged
merged 2 commits into from
Apr 10, 2024
Merged

Conversation

ondrejbudai
Copy link
Member

This PR adds a new functiondistro.ReadOSReleaseFromTree that can read an os-release(5) from a given tree. This is needed for osbuild/bootc-image-builder#338

This new method supports reading os-release from an arbitrary tree,
and it also correctly handles multiple os-release locations (see
os-release(5)). It's public so we can reuse it in multiple places.
The function now works even without /etc/os-release (which is rare
but possible). The function now also no longer panics if ID or
VERSION_ID aren't set. Some tests were added to cover everything.
Copy link
Member

@achilleas-k achilleas-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@achilleas-k achilleas-k added this pull request to the merge queue Apr 10, 2024
Merged via the queue into osbuild:main with commit ad45a75 Apr 10, 2024
14 of 16 checks passed
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