-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
Make service instances order the same as ports defined at service spec #36462
Make service instances order the same as ports defined at service spec #36462
Conversation
One thing I do not fully understand there - which one wins? is it just the
first one?
…On Tue, Dec 14, 2021 at 10:32 AM Pengyuan Bian ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In pkg/config/protocol/instance.go
<#36462 (comment)>:
> +var ProtocolOrder = map[Instance]int{
+ UDP: 1, Unsupported: 2, TCP: 3, TLS: 4, HTTPS: 5, MySQL: 6, Redis: 7, Mongo: 8,
+ Thrift: 9, HTTP: 10, HTTP_PROXY: 11, HTTP2: 12, GRPC: 13, GRPCWeb: 14,
If user have http2 and grpc, which works perfectly fine before, and should
not be downgraded.
I agree this is confusing, and I cannot find a clear way to set protocol
precedences. Probably we should go back to the original commit to just
remove protocol from target port dedup: 7e9835f
<7e9835f>.
It's a clean change and makes user service behave consistently, which is
strictly better than before where service could be broken or work in
different ways randomly. @howardjohn <https://github.com/howardjohn> wdyt?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#36462 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEYGXJGAXBBTH3VNW5C733UQ6ESRANCNFSM5JYPYECA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Yeah, with 7e9835f it will be the first one at service spec. |
a46c208
to
7e9835f
Compare
@@ -670,7 +670,7 @@ func TestGetProxyServiceInstancesWithMultiIPsAndTargetPorts(t *testing.T) { | |||
TargetPort: intstr.IntOrString{Type: intstr.Int, IntVal: 8080}, | |||
}, | |||
}, | |||
wantNum: 2, | |||
wantNum: 1, |
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.
Might be worth adding higher level tests that validate the listeners/clusters are right. Maybe in sidecar_simulation_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.
I tried to, but simulation tests are all based on service entry, which does not suffer from this dedup logic.
Also probably worth a release note |
added a release note. |
fix #36434
One port can only talk one protocol. This make selection of protocol stable if user have multiple services port pointing to the same target port with different protocols.