Repository navigation
Add wolfi to the list of OSs and fall back to VERSION_ID - #1385
dustinkirkland wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dustinkirkland The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @dustinkirkland! |
|
|
|
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 Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
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>
9caf833 to
33f0abd
Compare
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=wolfiisn't in thegetOSVersion()list and the host collector callsklog.Fatalfon the error:This PR:
ID=wolfithe same way aschainguard(added in Add chainguard to list of OSs #1355).VERSION_IDwhenVERSIONisn't set.VERSIONis optional in os-release(5), and both Wolfi and Chainguard only setVERSION_ID, soos_versionwas reported as"chainguard "with a trailing space. Distros that setVERSIONare unchanged.testdata/os-release-wolfi(the current file fromcgr.dev/chainguard/wolfi-base) andtestdata/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:
wolfigetsunsupported ID in /etc/os-release: "wolfi", andchainguardreturns"chainguard "instead of"chainguard 20230214". With this change,TestGetOSVersionLinuxpasses.go test -race -short ./...: 27 packages ok, both before and after the change.wolfi-basecontainer with--config.system-stats-monitor=config/system-stats-monitor.json --enable-k8s-exporter=false:/metricsshowsos_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?
🤖 Generated with Claude Code