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"
extensions "k8s.io/api/extensions/v1beta1"
"k8s.io/apimachinery/pkg/conversion"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/apimachinery/pkg/util/sets"
clientset "k8s.io/client-go/kubernetes"
@ -55,15 +54,6 @@ const (
rootLocation = "/"
)
var (
cloner *conversion.Cloner
)
func init() {
cloner := conversion.NewCloner()
cloner.RegisterDeepCopyFunc(ingress.GetGeneratedDeepCopyFuncs)
}
// Configuration contains all the settings required by an Ingress controller
type Configuration struct {
APIServerHost string
@ -554,17 +544,12 @@ func (n *NGINXController) getBackendServers(ingresses []*extensions.Ingress) ([]
if len(endps) > 0 {
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)
b, err := cloner.DeepCopy(upstream)
if err != nil {
glog.Errorf("unexpected error copying Upstream: %v", err)
} else {
name := fmt.Sprintf("custom-default-backend-%v", upstream.Name)
nb := b.(*ingress.Backend)
nb.Name = name
nb.Endpoints = endps
aUpstreams = append(aUpstreams, nb)
location.Backend = name
}
nb := upstream.DeepCopy()
name := fmt.Sprintf("custom-default-backend-%v", upstream.Name)
nb.Name = name
nb.Endpoints = endps
aUpstreams = append(aUpstreams, nb)
location.Backend = name
}
}
}