From c7bf08c263ea1100de72930db7790784c69408e8 Mon Sep 17 00:00:00 2001 From: Manuel de Brito Fontes Date: Wed, 4 Oct 2017 14:11:51 -0300 Subject: [PATCH] Fix proxy protocol check --- controllers/nginx/pkg/template/template.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/controllers/nginx/pkg/template/template.go b/controllers/nginx/pkg/template/template.go index 0cbb52f61..0e85f7cb1 100644 --- a/controllers/nginx/pkg/template/template.go +++ b/controllers/nginx/pkg/template/template.go @@ -32,7 +32,6 @@ import ( "github.com/pborman/uuid" - apiv1 "k8s.io/api/core/v1" extensions "k8s.io/api/extensions/v1beta1" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/ingress/controllers/nginx/pkg/config" @@ -678,9 +677,7 @@ func trustHTTPHeaders(input interface{}) bool { } return conf.Cfg.RealClientFrom == "http-proxy" || - (conf.Cfg.RealClientFrom == "auto" && !conf.Cfg.UseProxyProtocol || - (conf.Cfg.RealClientFrom == "auto" && conf.PublishService != nil && - conf.PublishService.Spec.Type == apiv1.ServiceTypeLoadBalancer)) + (conf.Cfg.RealClientFrom == "auto" && !conf.Cfg.UseProxyProtocol) } func trustProxyProtocol(input interface{}) bool {