Skip to content
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

Merged
merged 2 commits into from
Aug 19, 2019

Conversation

yskopets
Copy link
Contributor

changes:

  • add selectors to ProxyTemplate
  • rename sources into conf
  • when generating Envoy configuration for a Dataplane, pick ProxyTemplate with the highest number of matching key-value pairs

@yskopets yskopets added this to the 0.1 milestone Aug 16, 2019
}),
Entry("both selector and target are empty", testCase{
selector: nil,
target: nil,
Copy link
Contributor

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

Copy link
Contributor Author

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 {
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

@yskopets yskopets changed the base branch from feature/add-konvoyctl-get-proxytemplates to master August 19, 2019 07:58
@yskopets yskopets force-pushed the feature/add-selector-to-proxytemplate branch from ea8e791 to 185fc8c Compare August 19, 2019 08:53
@yskopets yskopets force-pushed the feature/add-selector-to-proxytemplate branch from 185fc8c to 0601c95 Compare August 19, 2019 08:55
@yskopets yskopets merged commit 95444da into master Aug 19, 2019
@yskopets yskopets deleted the feature/add-selector-to-proxytemplate branch August 22, 2019 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants