From 27ace6ba400c943b2d23d48281beb1a1db7462ea Mon Sep 17 00:00:00 2001 From: Aaron Walker Date: Thu, 3 Jan 2019 12:09:31 -0800 Subject: [PATCH] Fixed possibility of duplicate server.Alias --- internal/ingress/controller/controller.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/ingress/controller/controller.go b/internal/ingress/controller/controller.go index 07b2d2d85..20fb0ddaf 100644 --- a/internal/ingress/controller/controller.go +++ b/internal/ingress/controller/controller.go @@ -130,9 +130,9 @@ func (n *NGINXController) syncIngress(interface{}) error { for _, server := range servers { if !hosts.Has(server.Hostname) { hosts.Insert(server.Hostname) - if server.Alias != "" { - hosts.Insert(server.Alias) - } + } + if server.Alias != "" && !hosts.Has(server.Hostname) { + hosts.Insert(server.Alias) } if !server.SSLPassthrough {