Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kubelet: Ensure pods that have not started track a pendingUpdate
A pod that cannot be started yet (due to static pod fullname exclusion when UIDs are reused) must be accounted for in the pod worker since it is considered to have been admitted and will eventually start. Due to a bug we accidentally cleared pendingUpdate for pods that cannot start yet which means we can't report the right metric to users in kubelet_working_pods and in theory we might fail to start the pod in the future (although we currently have not observed that in tests that should catch such an error). Describe, implement, and test the invariant that when startPodSync returns in every path that either activeUpdate OR pendingUpdate is set on the status, but never both, and is only nil when the pod can never start. This bug was detected by a "programmer error" assertion we added on metrics that were not being reported, suggesting that we should be more aggressive on using log assertions and automating detection in tests.
- Loading branch information
1 parent
398e387
commit 861e193
Showing
2 changed files
with
82 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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