Repository navigation
fix(keeper): do not treat a pod without container statuses as started - #2162
Open
levin-kitty wants to merge 1 commit into
Open
levin-kitty wants to merge 1 commit into
levin-kitty wants to merge 1 commit into
Conversation
A pod that is not scheduled yet has an empty status.containerStatuses, so PodHasAllContainersStarted returned true for it. A new Keeper host waits only for this check, so a CHK whose pod was Pending was marked Completed. Signed-off-by: levin-kitty <levin.de.kitty@gmail.com>
This branch has not been deployed
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
When a pod is not scheduled yet,
status.containerStatusesis empty.In this case
PodHasAllContainersStartedreturnstrue, because the loop does not run.A new Keeper host waits only for this check. So when the Keeper pod is
Pending, the CHK still becomesCompleted.I saw this on 0.27.4. The Keeper pod was
Pendingbecause the PVC was not bound. The operator loggedHost pod startedafter about 5 seconds, and the CHK becameCompleted.Fix
Return
falsewhen there are no container statuses.IsPodOKin the same file already has the same check.After this fix, the wait should time out and the CHK should become
Aborted.Tests
I added
TestPodHasAllContainersStarted. The pending pod case fails without the fix.I ran unit tests only (
go test ./pkg/model/k8s/ ./pkg/controller/...). I did not run e2e tests.Note
I found that #2114 (draft) changes the same function with a stricter check.
This PR is a small fix only. If you don't need it, please close it.
Important items to consider before making a Pull Request
Please check items PR complies to:
next-releasebranch, not intomasterbranch1. More info--
1 If you feel your PR does not affect any Go-code or any testable functionality (for example, PR contains docs only or supplementary materials), PR can be made into
masterbranch, but it has to be confirmed by project's maintainer.