fix: provide non-sensitive KubeletStatus resource#13823
Open
smira wants to merge 1 commit into
Open
Conversation
Fixes siderolabs#13819 Provide a non-sensitive counterpart to KubeletSpec, consume it in the dashboard (for compatibility, in parallel with KubeletSpec). Fix the image tag parsing to correctly ignore digested references while I'm at it. Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
smira
commented
Jul 21, 2026
| // VersionFromImageRef extracts the tag out of the image reference, ignoring the digest (if present). | ||
| // | ||
| // It returns false if the reference can't be parsed or if the tag is missing. | ||
| func VersionFromImageRef(image string) (string, bool) { |
Member
Author
There was a problem hiding this comment.
todo (for myself): there might be more places where this can be used
There was a problem hiding this comment.
Pull request overview
This PR restores Kubernetes version visibility in the on-node console dashboard when running under os:reader by introducing a non-sensitive KubeletStatus resource (mirroring the kubelet image reference), while keeping backward compatibility by still watching KubeletSpec in parallel. It also centralizes and fixes kubelet image tag parsing to correctly handle tag+digest image references.
Changes:
- Add
k8s.KubeletStatus(non-sensitive) resource plus a controller that derives it fromk8s.KubeletSpec. - Update the dashboard resource watches and Kubernetes version rendering to use
KubeletStatuswhen available (andKubeletSpecotherwise). - Add
kubernetes.VersionFromImageRefhelper + tests to correctly extract the tag while ignoring digests.
Reviewed changes
Copilot reviewed 13 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| website/content/v1.14/reference/api.md | Documents the newly added KubeletStatusSpec in the API reference. |
| pkg/machinery/resources/k8s/kubelet_status.go | Introduces the KubeletStatus resource type (non-sensitive, exposes kubelet image ref). |
| pkg/machinery/resources/k8s/k8s.go | Adds KubeletStatusSpec to deep-copy generation list. |
| pkg/machinery/resources/k8s/k8s_test.go | Ensures KubeletStatus is included in resource registration tests. |
| pkg/machinery/resources/k8s/deep_copy.generated.go | Generated deep-copy method for KubeletStatusSpec. |
| api/resource/definitions/k8s/k8s.proto | Adds protobuf message definition for KubeletStatusSpec. |
| pkg/machinery/api/resource/definitions/k8s/k8s.pb.go | Generated protobuf Go bindings updated for KubeletStatusSpec. |
| pkg/machinery/api/resource/definitions/k8s/k8s_vtproto.pb.go | Generated vtproto marshal/size/unmarshal for KubeletStatusSpec. |
| internal/app/machined/pkg/controllers/k8s/kubelet_status.go | New controller publishing KubeletStatus from KubeletSpec. |
| internal/app/machined/pkg/controllers/k8s/kubelet_status_test.go | Controller test verifying reconcile/update/delete behavior. |
| internal/app/machined/pkg/runtime/v1alpha2/v1alpha2_state.go | Registers KubeletStatus resource in v1alpha2 runtime state. |
| internal/app/machined/pkg/runtime/v1alpha2/v1alpha2_controller.go | Registers KubeletStatusController in the v1alpha2 controller set. |
| internal/pkg/dashboard/resourcedata/resourcedata.go | Watches both KubeletSpec and KubeletStatus for compatibility across versions/RBAC. |
| internal/pkg/dashboard/components/kubernetesinfo.go | Consumes both resources and uses robust tag extraction for displayed Kubernetes version. |
| pkg/kubernetes/version.go | Adds VersionFromImageRef helper (tag extraction ignoring digest). |
| pkg/kubernetes/version_test.go | Adds unit tests covering tagged, tagged+digested, digested-only, and invalid refs. |
Files not reviewed (3)
- pkg/machinery/api/resource/definitions/k8s/k8s.pb.go: Generated file
- pkg/machinery/api/resource/definitions/k8s/k8s_vtproto.pb.go: Generated file
- pkg/machinery/resources/k8s/deep_copy.generated.go: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #13819
Provide a non-sensitive counterpart to KubeletSpec, consume it in the dashboard (for compatibility, in parallel with KubeletSpec).
Fix the image tag parsing to correctly ignore digested references while I'm at it.