Remove deprecated cloner helper
This commit is contained in:
parent
a09527cf6d
commit
f26331844b
1 changed files with 6 additions and 21 deletions
|
@ -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,17 +544,12 @@ 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 {
|
name := fmt.Sprintf("custom-default-backend-%v", upstream.Name)
|
||||||
glog.Errorf("unexpected error copying Upstream: %v", err)
|
nb.Name = name
|
||||||
} else {
|
nb.Endpoints = endps
|
||||||
name := fmt.Sprintf("custom-default-backend-%v", upstream.Name)
|
aUpstreams = append(aUpstreams, nb)
|
||||||
nb := b.(*ingress.Backend)
|
location.Backend = name
|
||||||
nb.Name = name
|
|
||||||
nb.Endpoints = endps
|
|
||||||
aUpstreams = append(aUpstreams, nb)
|
|
||||||
location.Backend = name
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue