-
Notifications
You must be signed in to change notification settings - Fork 95
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
feat: added interpolation to the prefix property of gcp_cloud_storage. #203
feat: added interpolation to the prefix property of gcp_cloud_storage. #203
Conversation
service.NewStringField(csiFieldPrefix). | ||
Description("An optional path prefix, if set only objects with the prefix are consumed."). | ||
service.NewInterpolatedStringField(csiFieldPrefix). | ||
Description("An optional path prefix, if set only objects with the prefix are consumed - supports interpolation."). |
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.
Description("An optional path prefix, if set only objects with the prefix are consumed - supports interpolation."). | |
Description("An optional path prefix, if set only objects with the prefix are consumed."). |
NewInterpolatedStringField will append a sentence to the Description - you can see it in website/docs/components/inputs/gcp_cloud_storage.md
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.
Thanks - fixed.
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.
Think will need to have a think about allowing a bloblang interpolation on an input component, because of the issue about not having a message to execute it against.
I think we might need wider thinking about how we can enable the flexibility of bloblang interpolations to input components, more generally. imo. Perhaps we should just add a section about it, to the page |
Thanks for the PR - question: Are you able to give an example config where you are using this / what use-case does this change solve? |
Most of the time is used for dealing with dates in the path, like this: /path/date=${!(timestamp_unix()-(26060)).format_timestamp_strftime("%Y-%m-%d-%H")} Or setting prefix based on other conditions - this could have been addressed with env vars - but the team finds it way more ergonomic, and we already have a good amount of pipelines like this. |
This PR adds interpolation to the prefix property of gcp_cloud_storage. Although there are no messages in context at this stage (so we have only bloblang expressions), it seems to be more ergonomic to deal with dynamic file filtering as input.