mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 08:17:26 +00:00
Merge pull request #18129 from yujuhong/fix_status
Auto commit by PR queue bot
This commit is contained in:
commit
073661514e
@ -343,8 +343,9 @@ func (m *manager) syncPod(uid types.UID, status versionedPodStatus) {
|
|||||||
// TODO: make me easier to express from client code
|
// TODO: make me easier to express from client code
|
||||||
pod, err := m.kubeClient.Pods(status.podNamespace).Get(status.podName)
|
pod, err := m.kubeClient.Pods(status.podNamespace).Get(status.podName)
|
||||||
if errors.IsNotFound(err) {
|
if errors.IsNotFound(err) {
|
||||||
glog.V(3).Infof("Pod %q (%s) was deleted on the server", status.podName, uid)
|
glog.V(3).Infof("Pod %q (%s) does not exist on the server", status.podName, uid)
|
||||||
m.deletePodStatus(uid)
|
// If the Pod is deleted the status will be cleared in
|
||||||
|
// RemoveOrphanedStatuses, so we just ignore the update here.
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
@ -264,8 +264,6 @@ func TestSyncBatchIgnoresNotFound(t *testing.T) {
|
|||||||
verifyActions(t, syncer.kubeClient, []testclient.Action{
|
verifyActions(t, syncer.kubeClient, []testclient.Action{
|
||||||
testclient.GetActionImpl{ActionImpl: testclient.ActionImpl{Verb: "get", Resource: "pods"}},
|
testclient.GetActionImpl{ActionImpl: testclient.ActionImpl{Verb: "get", Resource: "pods"}},
|
||||||
})
|
})
|
||||||
_, found := syncer.GetPodStatus(testPod.UID)
|
|
||||||
assert.False(t, found, "Pod status should have been deleted")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSyncBatch(t *testing.T) {
|
func TestSyncBatch(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user