set-labels: added support for sourcing label values from other resources#914
set-labels: added support for sourcing label values from other resources#914droot wants to merge 2 commits intokptdev:mainfrom
Conversation
|
I plan to add a generic dynamic input support in the go SDK. |
8000
I was wondering the same thing. Is it too much to use apply-replacements to target this |
It is. But the set-labels function is a curated function and we already have plans to change its functionConfig( yuanyi's original proposal). Adding a new feature ( i.e. the "labelsFrom" syntax) which we will have a more generic solution for (the go SDK) does not seem worth the user migration burden and the function owner's maintenance efforts. |
|
@droot Is this a critical feature for Bank-of-Anthos? If so, I can prioritize this work and do it on the go-SDK side. Otherwise, I'd recommend we use apply-replacements and set-labels. |
|
Would love to see this go in - currently using a workaround to push values into the set-labels function config |
This PR adds support for specifying label values from fields in the other resources in the package.
An example setlabel configuration where we add
myapplabel and value comes fromdata.namefield in package-context.yaml.Note the
labelsFrom. This change is also backward compatible sincelabelsFromis new field./cc @yuwenma @natasha41575
Note: I tested this manually. Will add tests if y'all agree with the direction.