-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix nginx conf test error when not found active service endpoints #2614
Conversation
@chenqz1987 please add e2e tests |
Codecov Report
@@ Coverage Diff @@
## master #2614 +/- ##
==========================================
- Coverage 40.86% 40.77% -0.09%
==========================================
Files 74 74
Lines 5083 5084 +1
==========================================
- Hits 2077 2073 -4
- Misses 2724 2729 +5
Partials 282 282
Continue to review full report at Codecov.
|
I'm not sure if I understood the issue correctly. nginx returns a 503 response when:
I created the Ingress from your example and here is the gerenated server (notice the absence of
What is the effect of setting |
@aledbf ok |
@antoineco yeah... you are right, but testing with master branch is not like this. It emits the following error:
and the nginx.conf is:
Because nginx go template checks it with location.Backend, we should set it empty when found unavailable endpoints. The code snippet is:
|
@chenqz1987 ah right, on And because I like traceability: introduced in #2524 |
@chenqz1987 please run |
@aledbf ok, done. |
/approve |
@chenqz1987 please rebase |
@aledbf done |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aledbf, chenqz1987 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@chenqz1987 thanks! |
What this PR does / why we need it:
Fix nginx config file test error when found no active service endpoints. For example:
Then the new nginx configuration file generated by ingress controller contains a proxy_pass that its upstream does not exist.
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #Special notes for your reviewer: