diff --git a/src/flb_upstream_ha.c b/src/flb_upstream_ha.c index 7856bf3df14..4d7928214f9 100644 --- a/src/flb_upstream_ha.c +++ b/src/flb_upstream_ha.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -108,6 +109,20 @@ struct flb_upstream_node *flb_upstream_ha_node_get(struct flb_upstream_ha *ctx) return node; } +static inline void translate_environment_variables(flb_sds_t *value, struct + flb_config *config) +{ + flb_sds_t result; + + result = flb_env_var_translate(config->env, *value); + + if (result != NULL) { + flb_sds_destroy(*value); + + *value = (flb_sds_t) result; + } +} + static struct flb_upstream_node *create_node(int id, struct flb_cf *cf, struct flb_cf_section *s, @@ -214,6 +229,16 @@ static struct flb_upstream_node *create_node(int id, /* tls.key_file */ tls_key_passwd = flb_cf_section_property_get_string(cf, s, "tls.key_passwd"); + translate_environment_variables((flb_sds_t *) &name, config); + translate_environment_variables((flb_sds_t *) &host, config); + translate_environment_variables((flb_sds_t *) &port, config); + translate_environment_variables((flb_sds_t *) &tls_vhost, config); + translate_environment_variables((flb_sds_t *) &tls_ca_path, config); + translate_environment_variables((flb_sds_t *) &tls_ca_file, config); + translate_environment_variables((flb_sds_t *) &tls_crt_file, config); + translate_environment_variables((flb_sds_t *) &tls_key_file, config); + translate_environment_variables((flb_sds_t *) &tls_key_passwd, config); + /* * Create hash table to store unknown key/values that might be used * by the caller plugin.