Merge pull request #3338 from aledbf/503
Avoid reloads when endpoints are not available
This commit is contained in:
commit
8cf40d3be7
2 changed files with 2 additions and 7 deletions
|
@ -1173,7 +1173,6 @@ stream {
|
||||||
proxy_set_header X-Service-Port $service_port;
|
proxy_set_header X-Service-Port $service_port;
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if not (empty $location.Backend) }}
|
|
||||||
{{ buildProxyPass $server.Hostname $all.Backends $location }}
|
{{ buildProxyPass $server.Hostname $all.Backends $location }}
|
||||||
{{ if (or (eq $location.Proxy.ProxyRedirectFrom "default") (eq $location.Proxy.ProxyRedirectFrom "off")) }}
|
{{ if (or (eq $location.Proxy.ProxyRedirectFrom "default") (eq $location.Proxy.ProxyRedirectFrom "off")) }}
|
||||||
proxy_redirect {{ $location.Proxy.ProxyRedirectFrom }};
|
proxy_redirect {{ $location.Proxy.ProxyRedirectFrom }};
|
||||||
|
@ -1181,10 +1180,6 @@ stream {
|
||||||
proxy_redirect {{ $location.Proxy.ProxyRedirectFrom }} {{ $location.Proxy.ProxyRedirectTo }};
|
proxy_redirect {{ $location.Proxy.ProxyRedirectFrom }} {{ $location.Proxy.ProxyRedirectTo }};
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
# No endpoints available for the request
|
|
||||||
return 503;
|
|
||||||
{{ end }}
|
|
||||||
{{ else }}
|
|
||||||
# Location denied. Reason: {{ $location.Denied | printf "%q" }}
|
# Location denied. Reason: {{ $location.Denied | printf "%q" }}
|
||||||
return 503;
|
return 503;
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -49,7 +49,7 @@ var _ = framework.IngressNginxDescribe("Service backend - 503", func() {
|
||||||
|
|
||||||
f.WaitForNginxServer(host,
|
f.WaitForNginxServer(host,
|
||||||
func(server string) bool {
|
func(server string) bool {
|
||||||
return strings.Contains(server, "return 503;")
|
return strings.Contains(server, "proxy_pass http://upstream_balancer;")
|
||||||
})
|
})
|
||||||
|
|
||||||
resp, _, errs := gorequest.New().
|
resp, _, errs := gorequest.New().
|
||||||
|
@ -72,7 +72,7 @@ var _ = framework.IngressNginxDescribe("Service backend - 503", func() {
|
||||||
|
|
||||||
f.WaitForNginxServer(host,
|
f.WaitForNginxServer(host,
|
||||||
func(server string) bool {
|
func(server string) bool {
|
||||||
return strings.Contains(server, "return 503;")
|
return strings.Contains(server, "proxy_pass http://upstream_balancer;")
|
||||||
})
|
})
|
||||||
|
|
||||||
resp, _, errs := gorequest.New().
|
resp, _, errs := gorequest.New().
|
||||||
|
|
Loading…
Reference in a new issue