diff --git a/internal/ingress/controller/template/template.go b/internal/ingress/controller/template/template.go index ca36c355e..6aaf43e2e 100644 --- a/internal/ingress/controller/template/template.go +++ b/internal/ingress/controller/template/template.go @@ -125,7 +125,6 @@ var ( "buildLocation": buildLocation, "buildAuthLocation": buildAuthLocation, "buildAuthResponseHeaders": buildAuthResponseHeaders, - "buildLoadBalancingConfig": buildLoadBalancingConfig, "buildProxyPass": buildProxyPass, "filterRateLimits": filterRateLimits, "buildRateLimitZones": buildRateLimitZones, @@ -405,31 +404,6 @@ func buildLogFormatUpstream(input interface{}) string { return cfg.BuildLogFormatUpstream() } -func buildLoadBalancingConfig(b interface{}, fallbackLoadBalancing string) string { - backend, ok := b.(*ingress.Backend) - if !ok { - glog.Errorf("expected an '*ingress.Backend' type but %T was returned", b) - return "" - } - - if backend.UpstreamHashBy != "" { - return fmt.Sprintf("hash %s consistent;", backend.UpstreamHashBy) - } - - if backend.LoadBalancing != "" { - if backend.LoadBalancing == "round_robin" { - return "" - } - return fmt.Sprintf("%s;", backend.LoadBalancing) - } - - if fallbackLoadBalancing == "round_robin" || fallbackLoadBalancing == "" { - return "" - } - - return fmt.Sprintf("%s;", fallbackLoadBalancing) -} - // buildProxyPass produces the proxy pass string, if the ingress has redirects // (specified through the nginx.ingress.kubernetes.io/rewrite-target annotation) // If the annotation nginx.ingress.kubernetes.io/add-base-url:"true" is specified it will