Parse environment variables in OpenTracing configuration
This commit is contained in:
parent
5c4854b537
commit
fc5e99a151
2 changed files with 17 additions and 11 deletions
|
|
@ -954,7 +954,7 @@ func createOpentracingCfg(cfg ngx_config.Configuration) error {
|
|||
return err
|
||||
}
|
||||
} else if cfg.JaegerCollectorHost != "" {
|
||||
tmpl, err = template.New("jarger").Parse(jaegerTmpl)
|
||||
tmpl, err = template.New("jaeger").Parse(jaegerTmpl)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -968,7 +968,10 @@ func createOpentracingCfg(cfg ngx_config.Configuration) error {
|
|||
return err
|
||||
}
|
||||
|
||||
return ioutil.WriteFile("/etc/nginx/opentracing.json", tmplBuf.Bytes(), file.ReadWriteByUser)
|
||||
// Expand possible environment variables before writing the configuration to file.
|
||||
expanded := os.ExpandEnv(string(tmplBuf.Bytes()))
|
||||
|
||||
return ioutil.WriteFile("/etc/nginx/opentracing.json", []byte(expanded), file.ReadWriteByUser)
|
||||
}
|
||||
|
||||
func cleanTempNginxCfg() error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue