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

@@ -578,10 +578,7 @@ func (dc *DeploymentController) syncDeployment(key string) error {
// Deep-copy otherwise we are mutating our cache.
// TODO: Deep-copy only when needed.
d, err := util.DeploymentDeepCopy(deployment)
if err != nil {
return err
}
d := deployment.DeepCopy()
everything := metav1.LabelSelector{}
if reflect.DeepEqual(d.Spec.Selector, &everything) {