From 3d23db53e6b05a173899161d3ead923cb3f00d91 Mon Sep 17 00:00:00 2001 From: Michail Kargakis Date: Wed, 19 Oct 2016 10:33:06 +0200 Subject: [PATCH] registry: remove redundant PDB deep-copy from eviction REST --- pkg/registry/core/pod/etcd/eviction.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pkg/registry/core/pod/etcd/eviction.go b/pkg/registry/core/pod/etcd/eviction.go index 6127f5c1af8..3aa788bdb7d 100644 --- a/pkg/registry/core/pod/etcd/eviction.go +++ b/pkg/registry/core/pod/etcd/eviction.go @@ -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 }