-
Notifications
You must be signed in to change notification settings - Fork 1.8k
env: add new extended format to handle environment variables #10862
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
base: master
Are you sure you want to change the base?
Changes from 16 commits
75c8668
0f9bb7f
9224e6d
f161887
c085436
4654fed
d5948fe
d78f10f
4b71063
746b463
8b4af90
fcb9bfe
c4f30bf
f33d942
ee16927
3296bdd
4e998ca
12a0576
e886e3b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,7 @@ | |
#define FLB_CONFIG_MAP_VARIANT 50 /* variant that wraps a kvlist or array */ | ||
|
||
#define FLB_CONFIG_MAP_MULT 1 | ||
#define FLB_CONFIG_MAP_DYNAMIC_ENV 2 /* flag: resolve environment variables at runtime */ | ||
|
||
struct flb_config_map_val { | ||
union { | ||
|
@@ -108,6 +109,12 @@ struct mk_list *flb_config_map_create(struct flb_config *config, | |
struct flb_config_map *map); | ||
void flb_config_map_destroy(struct mk_list *list); | ||
int flb_config_map_expected_values(int type); | ||
int flb_config_map_set(struct mk_list *properties, struct mk_list *map, void *context); | ||
int flb_config_map_set(struct flb_config *config, struct mk_list *properties, struct mk_list *map, void *context); | ||
|
||
Comment on lines
+112
to
+113
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainAPI break: flb_config_map_set now requires config; verify all call sites and out-of-tree impact This is a source/ABI-breaking change for plugins/tests calling the old 3-arg form. Ensure all in-repo uses are updated and call out the break in release notes for external plugins. 🏁 Script executed: #!/bin/bash
# List calls to flb_config_map_set with 3 vs 4 arguments.
# - Requires ast-grep in the runner.
echo "Calls with 3 args (old API):"
ast-grep --pattern $'flb_config_map_set($_, $_, $_)' || true
echo ""
echo "Calls with 4 args (new API):"
ast-grep --pattern $'flb_config_map_set($_, $_, $_, $_)' || true Length of output: 58 Document API signature change for flb_config_map_set No in-repo calls remain using the old 3-arg form; update the project’s release notes to highlight this source/ABI break for external plugins. |
||
/* Helper function to check if a config map entry has dynamic environment resolution */ | ||
static inline int flb_config_map_has_dynamic_env(struct flb_config_map *map) | ||
{ | ||
return (map->flags & FLB_CONFIG_MAP_DYNAMIC_ENV) != 0; | ||
} | ||
|
||
#endif |
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.
💡 Verification agent
❓ Verification inconclusive
Compatibility macro changes return type — likely API break.
Old flb_cf_env_property_add returned struct flb_kv*; the new macro returns struct flb_cf_env_var*. Call sites assigning to struct flb_kv* will fail.
Prefer a deprecated wrapper preserving the old signature to keep source/API compatibility:
If third parties may rely on the old exported symbol, also add a compat function in the .c to preserve ABI.
Preserve flb_cf_env_property_add API compatibility
flb_cf_env_property_add was changed from returning struct flb_kv* to invoking flb_cf_env_var_add (returning struct flb_cf_env_var*), which breaks third-party code expecting a flb_kv*. Supply a deprecated inline shim with the original signature:
If ABI compatibility is required, also define and export a compat symbol in the .c implementation.