summaryrefslogtreecommitdiffstats
path: root/lib/xdsconfig/fileconfig.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/xdsconfig/fileconfig.go')
-rw-r--r--lib/xdsconfig/fileconfig.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/xdsconfig/fileconfig.go b/lib/xdsconfig/fileconfig.go
index 2795206..1ad2ea3 100644
--- a/lib/xdsconfig/fileconfig.go
+++ b/lib/xdsconfig/fileconfig.go
@@ -75,11 +75,13 @@ func updateConfigFromFile(c *Config, confFile string) (*FileConfig, error) {
}
// Support environment variables (IOW ${MY_ENV_VAR} syntax) in agent-config.json
- for _, field := range []*string{
+ vars := []*string{
&fCfg.LogsDir,
- &fCfg.SThgConf.Home,
- &fCfg.SThgConf.BinDir} {
-
+ }
+ if fCfg.SThgConf != nil {
+ vars = append(vars, &fCfg.SThgConf.Home, &fCfg.SThgConf.BinDir)
+ }
+ for _, field := range vars {
var err error
*field, err = common.ResolveEnvVar(*field)
if err != nil {