Repository navigation
fix(pod): don't report Init:N/M for a started sidecar that is not ready - #4311
Merged
uozalp merged 2 commits intoOct 22, 2026
Merged
Conversation
Collaborator
|
@kevin9327 One test missing: a sidecar with Also the |
Contributor
Author
|
@uozalp Thanks, added in 8b657b1:
|
uozalp
approved these changes
Oct 22, 2026
uozalp
left a comment
Collaborator
There was a problem hiding this comment.
@kevin9327 thanks for the update
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.
Problem
A pod with a native sidecar (an init container with
restartPolicy: Always) whose readiness probe is failing showsInit:0/1in the STATUS column, even though the sidecar has started and the main containers are running. kubectl shows the same pod asRunning.In
checkInitContainerStatus, a started restartable init container only counts as done when it is also ready. Otherwise it falls through toInit:N/M. kubectl'sprintPodtreats a started sidecar as past initialization whether or not it is ready (readiness only affects the READY count):k9s's own
initContainerStatus, used byPodStatus, already skips sidecars in this case, so the two code paths also disagreed.Fix
A started restartable init container no longer blocks the phase. Readiness is still reflected in the READY column and in the pod health check, which haven't changed.
Tests
TestCheckPhasecaserestartable-started-not-ready: a started, not-ready sidecar plus a running, ready main container. It now givesRunning; before the fix it gaveInit:0/1.restartcase ofTest_checkInitContainerStatus, which recorded the old behaviour.go test ./internal/render/... ./internal/view/...passes.AI-assisted: I directed the investigation and reviewed and verified the change myself.