From cb4e3760931e48a89dda0fc0611cc387322fe21c Mon Sep 17 00:00:00 2001 From: Aaron Walker Date: Wed, 2 Jan 2019 12:23:59 -0800 Subject: [PATCH 1/2] Added server alias to metrics --- internal/ingress/controller/controller.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/ingress/controller/controller.go b/internal/ingress/controller/controller.go index e89e1fead..07b2d2d85 100644 --- a/internal/ingress/controller/controller.go +++ b/internal/ingress/controller/controller.go @@ -130,6 +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.SSLPassthrough { From 27ace6ba400c943b2d23d48281beb1a1db7462ea Mon Sep 17 00:00:00 2001 From: Aaron Walker Date: Thu, 3 Jan 2019 12:09:31 -0800 Subject: [PATCH 2/2] 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 {