Remove deprecated cloner helper

This commit is contained in:
Manuel de Brito Fontes 2018-01-07 12:03:00 -03:00
parent a09527cf6d
commit f26331844b
No known key found for this signature in database
GPG key ID: 786136016A8BA02A

View file

@ -31,7 +31,6 @@ import (
apiv1 "k8s.io/api/core/v1" apiv1 "k8s.io/api/core/v1"
extensions "k8s.io/api/extensions/v1beta1" extensions "k8s.io/api/extensions/v1beta1"
"k8s.io/apimachinery/pkg/conversion"
"k8s.io/apimachinery/pkg/util/intstr" "k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/sets"
clientset "k8s.io/client-go/kubernetes" clientset "k8s.io/client-go/kubernetes"
@ -55,15 +54,6 @@ const (
rootLocation = "/" rootLocation = "/"
) )
var (
cloner *conversion.Cloner
)
func init() {
cloner := conversion.NewCloner()
cloner.RegisterDeepCopyFunc(ingress.GetGeneratedDeepCopyFuncs)
}
// Configuration contains all the settings required by an Ingress controller // Configuration contains all the settings required by an Ingress controller
type Configuration struct { type Configuration struct {
APIServerHost string APIServerHost string
@ -554,12 +544,8 @@ func (n *NGINXController) getBackendServers(ingresses []*extensions.Ingress) ([]
if len(endps) > 0 { if len(endps) > 0 {
glog.V(3).Infof("using custom default backend in server %v location %v (service %v/%v)", glog.V(3).Infof("using custom default backend in server %v location %v (service %v/%v)",
server.Hostname, location.Path, location.DefaultBackend.Namespace, location.DefaultBackend.Name) server.Hostname, location.Path, location.DefaultBackend.Namespace, location.DefaultBackend.Name)
b, err := cloner.DeepCopy(upstream) nb := upstream.DeepCopy()
if err != nil {
glog.Errorf("unexpected error copying Upstream: %v", err)
} else {
name := fmt.Sprintf("custom-default-backend-%v", upstream.Name) name := fmt.Sprintf("custom-default-backend-%v", upstream.Name)
nb := b.(*ingress.Backend)
nb.Name = name nb.Name = name
nb.Endpoints = endps nb.Endpoints = endps
aUpstreams = append(aUpstreams, nb) aUpstreams = append(aUpstreams, nb)
@ -567,7 +553,6 @@ func (n *NGINXController) getBackendServers(ingresses []*extensions.Ingress) ([]
} }
} }
} }
}
// Configure Backends[].SSLPassthrough // Configure Backends[].SSLPassthrough
if server.SSLPassthrough { if server.SSLPassthrough {