-
Notifications
You must be signed in to change notification settings - Fork 303
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
NEG Namedport Fix #917
NEG Namedport Fix #917
Conversation
803808c
to
712ef59
Compare
712ef59
to
78760a3
Compare
5033005
to
49b138d
Compare
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.
pkg/neg/types/types.go
Outdated
// TargetPort is the target port of the service port | ||
// This can be port number or a named port | ||
TargetPort string | ||
// Tuple is port tuple of a service. |
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.
Tuple -> PortTuple
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
|
||
// Get returns the SvcPortTuple with matching svc port if found | ||
func (set SvcPortTupleSet) Get(svcPort int32) (SvcPortTuple, bool) { | ||
for tuple := range set { |
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.
Would there be any concern for this operation being O(N)?
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.
Assuming SvcPortTupleSet's scope is for all neg enabled services - would there be a possibility for conflicting svcPort?
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.
One SvcPortTupleSet
is usually extracted from one service. It was not used to store SvcPortTuple for multiple services.
So I guess it should not be too much a concern for efficiency. Also, Service Spec sort of guarantee uniqueness.
49b138d
to
eb2aa09
Compare
eb2aa09
to
02686b5
Compare
Added more unit test cases. /hold cancel |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: freehan, MrHohn 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 |
Fixes: #832