mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-01 18:58:18 +00:00
Treat first-seen, non-pending pods as updates
Kubelet doesn't perform checkpointing and loses all its internal states after restarts. It'd then mistaken pods from the api server as new pods and attempt to go through the admission process. This may result in pods being rejected even though they are running on the node (e.g., out of disk situation). This change adds a condition to check whether the pod was seen before and categorize such pods as updates. The change also removes freeze/unfreeze mechanism used to work around such cases, since it is no longer needed and it stopped working correctly ever since we switched to incremental updates.
This commit is contained in:
@@ -2482,7 +2482,6 @@ func updateDiskSpacePolicy(kubelet *Kubelet, mockCadvisor *cadvisor.Mock, rootCa
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
diskSpaceManager.Unfreeze()
|
||||
kubelet.diskSpaceManager = diskSpaceManager
|
||||
return nil
|
||||
}
|
||||
@@ -3612,6 +3611,15 @@ func TestRegisterExistingNodeWithApiserver(t *testing.T) {
|
||||
DockerVersion: "1.5.0",
|
||||
}
|
||||
mockCadvisor.On("VersionInfo").Return(versionInfo, nil)
|
||||
mockCadvisor.On("DockerImagesFsInfo").Return(cadvisorapiv2.FsInfo{
|
||||
Usage: 400 * mb,
|
||||
Capacity: 1000 * mb,
|
||||
Available: 600 * mb,
|
||||
}, nil)
|
||||
mockCadvisor.On("RootFsInfo").Return(cadvisorapiv2.FsInfo{
|
||||
Usage: 9 * mb,
|
||||
Capacity: 10 * mb,
|
||||
}, nil)
|
||||
|
||||
done := make(chan struct{})
|
||||
go func() {
|
||||
|
||||
Reference in New Issue
Block a user