[Cherry Pick] - Fix default backend annotation and tests (#7487)
* Make custom-default-backend upstream name more unique. Signed-off-by: Robin Elfrink <robin.elfrink@eu.equinix.com> * Fix default backend annotation test (#7486) Co-authored-by: Robin Elfrink <robin.elfrink@eu.equinix.com>
This commit is contained in:
parent
f973f3ffda
commit
a091b01f43
2 changed files with 3 additions and 3 deletions
|
@ -727,7 +727,7 @@ func (n *NGINXController) getBackendServers(ingresses []*ingress.Ingress) ([]*in
|
|||
endps := getEndpoints(location.DefaultBackend, &sp, apiv1.ProtocolTCP, n.store.GetServiceEndpoints)
|
||||
// custom backend is valid only if contains at least one endpoint
|
||||
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)
|
||||
|
||||
nb := upstream.DeepCopy()
|
||||
|
|
|
@ -116,7 +116,7 @@ var _ = framework.DescribeAnnotation("custom-http-errors", func() {
|
|||
}
|
||||
return false
|
||||
})
|
||||
assert.Contains(ginkgo.GinkgoT(), serverConfig, errorBlockName(fmt.Sprintf("custom-default-backend-%s", customDefaultBackend), "503"))
|
||||
assert.Contains(ginkgo.GinkgoT(), serverConfig, fmt.Sprintf("error_page %s = %s", "503", errorBlockName(fmt.Sprintf("custom-default-backend-%s", customDefaultBackend), "503")))
|
||||
assert.Contains(ginkgo.GinkgoT(), serverConfig, errorBlockName(fmt.Sprintf("custom-default-backend-%s-%s", f.Namespace, customDefaultBackend), "503"))
|
||||
assert.Contains(ginkgo.GinkgoT(), serverConfig, fmt.Sprintf("error_page %s = %s", "503", errorBlockName(fmt.Sprintf("custom-default-backend-%s-%s", f.Namespace, customDefaultBackend), "503")))
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue