-
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
control-plane: add selector to ProxyTemplate #114
Conversation
}), | ||
Entry("both selector and target are empty", testCase{ | ||
selector: nil, | ||
target: nil, |
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.
should selector and target be an empty map? if not then this test case and above can be merged
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.
yeah, it's a typo (should be map[string]string{}
).
Thanks!
return r.DefaultProxyTemplate | ||
} | ||
|
||
func FindBestMatch(proxy *model.Proxy, templates []*mesh_core.ProxyTemplateResource) *mesh_core.ProxyTemplateResource { |
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.
Some comment would be nice here like:
// For template to match, it has to match all tags of any inbound of the dataplane.
// Matched templates are scored by the number of tags.
// Template without any tag is a match but has a score of 0.
// If there are multiple templates with the same score, the first one is picked (by alphabetic order)
WDYT?
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.
added
ea8e791
to
185fc8c
Compare
185fc8c
to
0601c95
Compare
changes:
selectors
toProxyTemplate
sources
intoconf
Dataplane
, pickProxyTemplate
with the highest number of matching key-value pairs