-
Notifications
You must be signed in to change notification settings - Fork 15
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
support data source in transform #397
Conversation
source/extensions/filters/http/transformation/inja_transformer.cc
Outdated
Show resolved
Hide resolved
… the actual pr description for a better real desc
api/envoy/config/filter/http/transformation/v2/transformation_filter.proto
Outdated
Show resolved
Hide resolved
|
||
const auto &data_sources = transformation.data_sources(); | ||
for (auto it = data_sources.begin(); it != data_sources.end(); it++) { | ||
auto provider_or_error = Envoy::Config::DataSource::DataSourceProvider::create( |
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'm not super familiar with the Envoy::Config::DataSource::DataSourceProvider::create
. Does this load the data on the data path or pre-load? Doing the former seems potentially expensive.
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.
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.
So this is using it like how the router filter is using it.
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.
yes, it watches for file updates
This PR introduces 2 new features for transformation.
First is the trim option which will trim ascii whitespace from both the start and end of the value provided.
This can be used like so: {{ trim(my_super_cool_value) }}
Second is the datasource option. This pulls from a mounted datasource to provide data or an empty string.
This can be used like so {{ data_source("my_cool_mounted_file") }}
One may often want to use the trim functionality in combination with this new feature.