Skip to content

Commit

Permalink
Populate DisruptedPods field for non-dry run
Browse files Browse the repository at this point in the history
  • Loading branch information
tedyu authored and yutedz committed Jul 4, 2019
1 parent f978c4c commit 2dae73e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/registry/core/pod/storage/eviction.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,15 @@ func (r *EvictionREST) checkAndDecrement(namespace string, podName string, pdb p
}

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 dryRun == true {
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
// 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
Expand Down

0 comments on commit 2dae73e

Please sign in to comment.