Skip to content

OS resolver missing os-release file fallback / guess#313

Merged
kke merged 2 commits into
mainfrom
os-release-fallback
Apr 21, 2026
Merged

OS resolver missing os-release file fallback / guess#313
kke merged 2 commits into
mainfrom
os-release-fallback

Conversation

@kke
Copy link
Copy Markdown
Contributor

@kke kke commented Apr 21, 2026

When an os-release file is not found, try to guess based on an installed package manager.

Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
@kke kke added the enhancement New feature or request label Apr 21, 2026
@kke kke requested a review from Copilot April 21, 2026 08:16
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a Linux OS-release resolver fallback for environments where /etc/os-release and /usr/lib/os-release are missing, by probing for known package manager binaries and synthesizing an *os.Release.

Changes:

  • Added ResolveLinuxCompat resolver that guesses distro/family based on detected package manager binaries.
  • Added RegisterLinuxCompat helper to register the compat resolver.
  • Registered ResolveLinuxCompat in the default OS resolver registry after ResolveLinux.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
os/linux_compat.go Introduces the Linux “compatibility mode” resolver that probes package managers and synthesizes a Release.
os/defaultprovider.go Registers the new compat resolver in the default resolver chain.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread os/linux_compat.go Outdated
Comment thread os/linux_compat.go Outdated
Comment thread os/linux_compat.go Outdated
Comment thread os/linux_compat.go Outdated
Comment thread os/linux_compat.go
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
@kke kke marked this pull request as ready for review April 21, 2026 09:02
@kke kke merged commit 315aa2e into main Apr 21, 2026
11 checks passed
@kke kke deleted the os-release-fallback branch April 21, 2026 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants