Skip to content

Conversation

yuval-k
Copy link
Contributor

@yuval-k yuval-k commented Apr 4, 2018

This adds cluster_metadata to route entry so that a filter can get metadata that is specific to the
cluster chosen for routing. A "cluster_metadata" field was added to the RouteAction configuration (see
link to the data plane PR)
Risk Level: Low/Medium

Testing:
Added a unit test to config_impl_test.cc

Docs Changes:
original data pr:
envoyproxy/data-plane-api#598
final pr that unhides docs:
envoyproxy/data-plane-api#607

Release Notes:
envoyproxy/data-plane-api#607

Fixes #2851

API Changes:
envoyproxy/data-plane-api#598

@rshriram
Copy link
Member

rshriram commented Apr 5, 2018

Hi. I think this is essentially implementing route local filter configuration. https://github.com/envoyproxy/data-plane-api/issues/540

I suggest two things: renaming this field to “filter_config”, and adding another filter config under virtual host. Then everyone could use this field in their filters for their respective needs.

Copy link
Member

@rshriram rshriram left a comment

Choose a reason for hiding this comment

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

I suggest repurposing this to route local config and having a map of filter name to struct. It’s more extendible and useful for all filters.


if (cluster.has_cluster_metadata()) {
cluster_metadata_.MergeFrom(cluster.cluster_metadata());
}
Copy link
Member

Choose a reason for hiding this comment

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

How will this work when both have same keys?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The docs for MergeFrom state that 'Singular fields will be overwritten, if specified in from, except for embedded messages which will be merged. Repeated fields will be concatenated'.
Are you asking specifically how MergeFrom works for maps?

@yuval-k
Copy link
Contributor Author

yuval-k commented Apr 5, 2018

I think these are slightly different - this metadata is for the routed cluster; and appears on the RouteEntry interface;
where the PR linked seems to be more about routes in general, and appears in the Route interace. (and hence applies to routes that don't route to a cluster)

@yuval-k
Copy link
Contributor Author

yuval-k commented Apr 5, 2018

IIRC Metadata has a filter_metadata field that is a map from filter name to struct. is that what you mean?

@htuch
Copy link
Member

htuch commented Apr 5, 2018

I think it would be good to clarify the intended use of the metadata. If this is purely for consumption via logging/stats, what we have in this PR and the corresponding data-plane-api makes a lot of sense. If this is for per-route or per-weighted cluster additional filter configuration, we probably want to call this out specifically as configuration as per envoyproxy/data-plane-api#605.

@htuch htuch self-assigned this Apr 5, 2018
@yuval-k
Copy link
Contributor Author

yuval-k commented Apr 5, 2018

the intention is per-weighted cluster additional filter configuration. chiming in to the discussion at envoyproxy/data-plane-api#605

@htuch
Copy link
Member

htuch commented Apr 5, 2018

OK, let's continue the discussion there. I don't think it would be good to have two distinct ways to provide per-route or per-weighted cluster configuration, and we shouldn't call something metadata if it's really configuration, best to call that out as a first class concept.

@mattklein123
Copy link
Member

+1 we should clearly split up metadata for logging and filter configuration. @yuval-k @rodaine can you coordinate to see if any of the previous data-plane-api PR on the metadat needs to be reverted?

@yuval-k
Copy link
Contributor Author

yuval-k commented Apr 5, 2018

@mattklein123 just had a chat with @rodaine. It seems that my intention with this PR are a subset of what he is doing. so I can close this PR.
Do I need to submit a PR to revert my previous data plane PR? (as I think github has another way to do it, right?).

@mattklein123
Copy link
Member

@yuval-k please just work with @rodaine to either revert your data-plane-api PR or just do the revert as part of his PR that he has open now. Thanks!

@mattklein123
Copy link
Member

Going to close this per discussion.

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.

4 participants