Skip to content

Add wolfi to the list of OSs and fall back to VERSION_ID - #1385

Open
dustinkirkland wants to merge 1 commit into
kubernetes:masterfrom
dustinkirkland:chainguard/os-release-version-id
Open

dustinkirkland wants to merge 1 commit into
kubernetes:masterfrom
dustinkirkland:chainguard/os-release-version-id

Conversation

@dustinkirkland

Copy link
Copy Markdown

What type of PR is this?

/kind bug

What this PR does / why we need it:

With the system-stats monitor enabled, node-problem-detector exits right after startup on Wolfi-based images, because ID=wolfi isn't in the getOSVersion() list and the host collector calls klog.Fatalf on the error:

F1026 16:03:36.590971  7 host_collector.go:44] Failed to retrieve OS version: unsupported ID in /etc/os-release: "wolfi"

This PR:

  • handles ID=wolfi the same way as chainguard (added in Add chainguard to list of OSs #1355).
  • falls back to VERSION_ID when VERSION isn't set. VERSION is optional in os-release(5), and both Wolfi and Chainguard only set VERSION_ID, so os_version was reported as "chainguard " with a trailing space. Distros that set VERSION are unchanged.
  • adds testdata/os-release-wolfi (the current file from cgr.dev/chainguard/wolfi-base) and testdata/os-release-chainguard (the file from Add chainguard to list of OSs #1355), plus test cases for both.

Which issue(s) this PR fixes:

None filed. I can open one if you'd prefer.

Special notes for your reviewer:

Tests:

  • On master, the new cases fail: wolfi gets unsupported ID in /etc/os-release: "wolfi", and chainguard returns "chainguard " instead of "chainguard 20230214". With this change, TestGetOSVersionLinux passes.
  • go test -race -short ./...: 27 packages ok, both before and after the change.
  • I also ran it end to end in a wolfi-base container with --config.system-stats-monitor=config/system-stats-monitor.json --enable-k8s-exporter=false:
    • master exits with the fatal above.
    • with this change it logs "Start system stats monitor" and "Problem detector started", and /metrics shows os_version="wolfi 20230201".

Chainguard carries this patch downstream in its node-problem-detector package. I'd like to drop it once a release includes this.

Prepared with AI assistance (Claude Code); reviewed and tested by the submitter.

Does this PR introduce a user-facing change?

node-problem-detector no longer exits at startup on Wolfi-based hosts when the system-stats monitor is enabled. The os_version label now falls back to VERSION_ID when /etc/os-release has no VERSION field (for example Wolfi and Chainguard).

🤖 Generated with Claude Code

@kubernetes-prow kubernetes-prow Bot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 26, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dustinkirkland
Once this PR has been reviewed and has the lgtm label, please assign sjenning for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow

Copy link
Copy Markdown
Contributor

Welcome @dustinkirkland!

It looks like this is your first PR to kubernetes/node-problem-detector 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/node-problem-detector has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@kubernetes-prow kubernetes-prow Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 26, 2026
@linux-foundation-easycla

linux-foundation-easycla Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: dustinkirkland / name: Dustin Kirkland (33f0abd)

@kubernetes-prow

Copy link
Copy Markdown
Contributor

Hi @dustinkirkland. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kubernetes-prow kubernetes-prow Bot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 26, 2026
With the system-stats monitor enabled, node-problem-detector exits at
startup on Wolfi-based images:

  F... host_collector.go:44] Failed to retrieve OS version: unsupported
  ID in /etc/os-release: "wolfi"

Handle ID=wolfi the same way as chainguard. Both distributions ship an
os-release with VERSION_ID but no VERSION (VERSION is optional in
os-release(5)), so os_version was reported as "chainguard " with a
trailing space. Fall back to VERSION_ID when VERSION is not set, and add
test fixtures for both.

Assisted-by: Claude Code (Anthropic)
Signed-off-by: Dustin Kirkland <kirkland@chainguard.dev>
@dustinkirkland
dustinkirkland force-pushed the chainguard/os-release-version-id branch from 9caf833 to 33f0abd Compare October 26, 2026 18:23
@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant