-
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
Revert removal of support for TCP and UDP services #3374
Conversation
7575135
to
0a82c69
Compare
0a82c69
to
4f14db4
Compare
d61cf7c
to
60e540f
Compare
c76f98b
to
7b3f3eb
Compare
69cacfb
to
139caa4
Compare
139caa4
to
168f30d
Compare
@ElvinEfendi this is ready for an initial review. I will add e2e tests |
49b0e24
to
592af64
Compare
end | ||
|
||
local ctx = ngx.ctx | ||
if not ctx.has_run then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to effectively ignore proxy_next_upstream_tries
and will always try next upstream peer only once.
I think we should keep the same logic we have for http
subsystem here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
592af64
to
7aa7a0e
Compare
internal/ingress/controller/nginx.go
Outdated
if err != nil { | ||
return err | ||
} | ||
defer conn.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you already have this above, why do you need it again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
defer conn.Close() | ||
} | ||
}() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a mock right? If so can you extract this into a function that describes it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
return false | ||
} | ||
} | ||
if len(c1.PassthroughBackends) != len(c2.PassthroughBackends) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not related to UDP TCP revert, right? Seems like needs to be grouped with line 90.
test/e2e/tcpudp/tcp.go
Outdated
resp, _, errs := gorequest.New(). | ||
Get(fmt.Sprintf("http://%v:%v", ip, port)). | ||
End() | ||
Expect(len(errs)).Should(BeNumerically("==", 0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use BeEmpty instead? That will reveal more when error happens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Get(fmt.Sprintf("http://%v:%v", ip, port)). | ||
End() | ||
Expect(len(errs)).Should(BeNumerically("==", 0)) | ||
Expect(resp.StatusCode).Should(Equal(200)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are you asserting here with an HTTP request?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am asserting the response from the echo deployment request returns 200 (I am not sure what to exactly test)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we would need something similar to echo deployment but instead of HTTP it should be speaking TCP. Then instead of sending HTTP request we could send TCP stream and assert on expected stream response.
@aledbf this is looking good! Just a few minor comments. e2e test coverage can be improved a bit to make sure it actually load balances across backends - that will ensure core feature works. Later I'll try to refactor Lua code and unify stream and http subsystems to avoid duplication in balancer modules. |
7aa7a0e
to
af2dce9
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aledbf, ElvinEfendi 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 |
What this PR does / why we need it:
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: