registry: remove redundant PDB deep-copy from eviction REST

This commit is contained in:
Michail Kargakis 2016-10-19 10:33:06 +02:00
parent 66a0aa64c2
commit 3d23db53e6

View File

@ -107,14 +107,8 @@ func (r *EvictionREST) checkAndDecrement(namespace string, pdb policy.PodDisrupt
return false, nil
}
copied, err := api.Scheme.DeepCopy(pdb)
if err != nil {
return false, err
}
newPDB := copied.(policy.PodDisruptionBudget)
newPDB.Status.PodDisruptionAllowed = false
if _, err := r.podDisruptionBudgetClient.PodDisruptionBudgets(namespace).Update(&newPDB); err != nil {
pdb.Status.PodDisruptionAllowed = false
if _, err := r.podDisruptionBudgetClient.PodDisruptionBudgets(namespace).Update(&pdb); err != nil {
return false, err
}