controllers: simplify deepcopy calls

This commit is contained in:
Dr. Stefan Schimanski
2017-08-15 14:14:21 +02:00
parent 28f6b3fcc0
commit 1d053c4f7c
50 changed files with 86 additions and 475 deletions

View File

@@ -21,7 +21,6 @@ import (
"k8s.io/api/core/v1"
errorsutil "k8s.io/apimachinery/pkg/util/errors"
"k8s.io/client-go/kubernetes/scheme"
v1core "k8s.io/client-go/kubernetes/typed/core/v1"
corelisters "k8s.io/client-go/listers/core/v1"
"k8s.io/client-go/util/retry"
@@ -42,11 +41,7 @@ func UpdatePodWithRetries(podClient v1core.PodInterface, podLister corelisters.P
if err != nil {
return err
}
obj, deepCopyErr := scheme.Scheme.DeepCopy(pod)
if deepCopyErr != nil {
return deepCopyErr
}
pod = obj.(*v1.Pod)
pod = pod.DeepCopy()
// Apply the update, then attempt to push it to the apiserver.
if applyErr := applyUpdate(pod); applyErr != nil {
return applyErr