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

support data source in transform #397

Merged
merged 5 commits into from
Feb 3, 2025
Merged

Conversation

yuval-k
Copy link
Member

@yuval-k yuval-k commented Jan 31, 2025

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.

… the actual pr description for a better real desc
@nfuden nfuden enabled auto-merge (squash) February 3, 2025 14:46

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(
Copy link
Member

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.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

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.

Copy link
Member Author

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

@nfuden nfuden merged commit 2d87242 into main Feb 3, 2025
4 checks passed
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.

3 participants