-
Notifications
You must be signed in to change notification settings - Fork 327
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
feat(kuma-cp) Support many tags in Ingress #842
Conversation
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.
Looks OK to me.
} | ||
if tlsContext != nil { | ||
pbst, err := proto.MarshalAnyDeterministic(tlsContext) | ||
// there might be a situation when there are multiple sam tags passed here for example two outbound listeners with the same tags, therefore we need to distinct them. |
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.
nit: "we need to distinguish between them"
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 have really stingy review :) Overall looks great, very seamless experience for the user that utilizes Ingress!
pkg/xds/envoy/tls/sni.go
Outdated
} | ||
|
||
func TagsFromSNI(sni string) map[string]string { | ||
r := regexp.MustCompile(`(.*)\{(.*)\}`) |
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 overlooked that during my PR, it makes sense to extract regex to global scope
pkg/xds/envoy/types.go
Outdated
} | ||
|
||
func DistinctTags(tags []Tags) []Tags { | ||
if len(tags) == 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.
We don't need this check since we iterate over tags
in loop
pkg/xds/envoy/tls/sni.go
Outdated
func SNIFromTags(tags envoy.Tags) string { | ||
nonServiceTags := tags.WithoutTag(mesh_proto.ServiceTag) | ||
var pairs []string | ||
for _, key := range nonServiceTags.Keys() { |
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 we reuse tags.String()
method here?
Summary
This PR introduces support for many tag in Ingress - meaning you can apply TrafficRoute like this
or this (when version: 2 is in different cluster)
Documentation
Will be a part of Multi Cluster docs/demo. From user perspective is just a regular TrafficRoute