Make custom-default-backend upstream name more unique.

Signed-off-by: Robin Elfrink <robin.elfrink@eu.equinix.com>
This commit is contained in:
Robin Elfrink 2021-08-11 08:53:44 +02:00
parent 402f21bcb7
commit 8ee98e9422

View file

@ -724,7 +724,7 @@ func (n *NGINXController) getBackendServers(ingresses []*ingress.Ingress) ([]*in
endps := getEndpoints(location.DefaultBackend, &sp, apiv1.ProtocolTCP, n.store.GetServiceEndpoints) endps := getEndpoints(location.DefaultBackend, &sp, apiv1.ProtocolTCP, n.store.GetServiceEndpoints)
// custom backend is valid only if contains at least one endpoint // custom backend is valid only if contains at least one endpoint
if len(endps) > 0 { if len(endps) > 0 {
name := fmt.Sprintf("custom-default-backend-%v", location.DefaultBackend.GetName()) name := fmt.Sprintf("custom-default-backend-%v-%v", location.DefaultBackend.GetNamespace(), location.DefaultBackend.GetName())
klog.V(3).Infof("Creating \"%v\" upstream based on default backend annotation", name) klog.V(3).Infof("Creating \"%v\" upstream based on default backend annotation", name)
nb := upstream.DeepCopy() nb := upstream.DeepCopy()