Merge pull request #79812 from tedyu/pdb-decrement

Populate DisruptedPods field for non-dry run
This commit is contained in:
Kubernetes Prow Robot 2019-07-05 22:00:34 -07:00 committed by GitHub
commit e1b757b654
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -220,15 +220,15 @@ func (r *EvictionREST) checkAndDecrement(namespace string, podName string, pdb p
} }
pdb.Status.PodDisruptionsAllowed-- pdb.Status.PodDisruptionsAllowed--
if pdb.Status.DisruptedPods == nil {
pdb.Status.DisruptedPods = make(map[string]metav1.Time)
}
// If this is a dry-run, we don't need to go any further than that. // If this is a dry-run, we don't need to go any further than that.
if dryRun == true { if dryRun == true {
return nil return nil
} }
if pdb.Status.DisruptedPods == nil {
pdb.Status.DisruptedPods = make(map[string]metav1.Time)
}
// Eviction handler needs to inform the PDB controller that it is about to delete a pod // Eviction handler needs to inform the PDB controller that it is about to delete a pod
// so it should not consider it as available in calculations when updating PodDisruptions allowed. // so it should not consider it as available in calculations when updating PodDisruptions allowed.
// If the pod is not deleted within a reasonable time limit PDB controller will assume that it won't // If the pod is not deleted within a reasonable time limit PDB controller will assume that it won't