Fix defaultServer backend update for Ingress with defaultBackend. (#8825)

This commit is contained in:
Harpreet singh 2022-08-23 07:26:23 +08:00 committed by GitHub
parent d5893d4a2e
commit 69318355b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 6 deletions

View file

@ -93,5 +93,13 @@ var _ = framework.IngressNginxDescribe("[Ingress] definition without host", func
WithHeader("Host", "only-backend").
Expect().
Status(http.StatusOK)
// Following assertion added with respect to issue https://github.com/kubernetes/ingress-nginx/issues/8823
// This check ensure that ingress having defaultBackend with rules should only be added as default backend
// for the host mentioned in rule. It should not affect the default catch-all server_name _ block.
f.HTTPTestClient().
GET("/").
WithHeader("Host", "only-backend-doesnotexist").
Expect().
Status(http.StatusNotFound)
})
})