// when a pod is deleted gracefully it's deletion timestamp is first modified to reflect a grace period,
// and after such time has passed, the kubelet actually deletes it from the store. We receive an update
// for modification of the deletion timestamp and expect an rs to create more replicas asap, not wait
// until the kubelet actually deletes the pod. This is different from the Phase of a pod changing, because
// an rs never initiates a phase change, and so is never asleep waiting for the same.
glog.V(4).Infof("Update to pod %v with deletion timestamp %+v counted as delete for rs %v",curPod.Name,curPod.DeletionTimestamp,rsKey)
rsc.expectations.DeletionObserved(rsKey)
}else{
glog.V(4).Infof("Update to pod %v with deletion timestamp %+v. Not counting it as a new deletion for rs %v",curPod.Name,curPod.DeletionTimestamp,rsKey)
glog.V(4).Infof("Pod %s/%s deleted through %v, timestamp %+v: %+v.",pod.Namespace,pod.Name,utilruntime.GetCaller(),pod.DeletionTimestamp,pod)
ifrs:=rsc.getPodReplicaSet(pod);rs!=nil{
rsKey,err:=controller.KeyFunc(rs)
iferr!=nil{
glog.Errorf("Couldn't get key for ReplicaSet %#v: %v",rs,err)
return
}
// This method only manages expectations for the case where a pod is
// deleted without a grace period.
ifpod.DeletionTimestamp==nil{
glog.V(4).Infof("Received new delete for rs %v, pod %v",rsKey,pod.Name)
rsc.expectations.DeletionObserved(rsKey)
}else{
glog.V(4).Infof("Received delete for rs %v pod %v with non nil deletion timestamp %+v. Not counting it as a new deletion.",rsKey,pod.Name,pod.DeletionTimestamp)
// when a pod is deleted gracefully it's deletion timestamp is first modified to reflect a grace period,
// and after such time has passed, the kubelet actually deletes it from the store. We receive an update
// for modification of the deletion timestamp and expect an rc to create more replicas asap, not wait
// until the kubelet actually deletes the pod. This is different from the Phase of a pod changing, because
// an rc never initiates a phase change, and so is never asleep waiting for the same.
glog.V(4).Infof("Update to pod %v with deletion timestamp %+v counted as delete for rc %v",curPod.Name,curPod.DeletionTimestamp,rcKey)
rm.expectations.DeletionObserved(rcKey)
}else{
glog.V(4).Infof("Update to pod %v with deletion timestamp %+v. Not counting it as a new deletion for rc %v.",curPod.Name,curPod.DeletionTimestamp,rcKey)
rm.deletePod(curPod)
return
}
rm.enqueueController(rc)
// Only need to get the old controller if the labels changed.
glog.V(4).Infof("Pod %s/%s deleted through %v, timestamp %+v, labels %+v.",pod.Namespace,pod.Name,utilruntime.GetCaller(),pod.DeletionTimestamp,pod.Labels)
ifrc:=rm.getPodController(pod);rc!=nil{
rcKey,err:=controller.KeyFunc(rc)
iferr!=nil{
glog.Errorf("Couldn't get key for replication controller %#v: %v",rc,err)
return
}
// This method only manages expectations for the case where a pod is
// deleted without a grace period.
ifpod.DeletionTimestamp==nil{
glog.V(4).Infof("Received new delete for rc %v, pod %v",rcKey,pod.Name)
rm.expectations.DeletionObserved(rcKey)
}else{
glog.V(4).Infof("Received delete for rc %v pod %v with non nil deletion timestamp %+v. Not counting it as a new deletion.",rcKey,pod.Name,pod.DeletionTimestamp)