From 3e51b0db44f015fc611040a5d8fbbfc75f4cecd5 Mon Sep 17 00:00:00 2001 From: Alex Rowley Date: Fri, 27 Oct 2017 12:46:32 +0100 Subject: [PATCH] Only set alias if not already set --- pkg/ingress/controller/controller.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkg/ingress/controller/controller.go b/pkg/ingress/controller/controller.go index d6608f8b2..8d9ff2f03 100644 --- a/pkg/ingress/controller/controller.go +++ b/pkg/ingress/controller/controller.go @@ -998,10 +998,15 @@ func (ic *GenericController) createServers(data []*extensions.Ingress, } // setup server aliases - servers[host].Alias = aliasAnnotation if aliasAnnotation != "" { - if _, ok := aliases[aliasAnnotation]; !ok { - aliases[aliasAnnotation] = host + if servers[host].Alias == "" { + servers[host].Alias = aliasAnnotation + if _, ok := aliases[aliasAnnotation]; !ok { + aliases[aliasAnnotation] = host + } + } else { + glog.Warningf("ingress %v/%v for host %v contains an Alias but one has already been configured.", + ing.Namespace, ing.Name, host) } }