Skip to content

Commit

Permalink
Change expected hostname env var name
Browse files Browse the repository at this point in the history
The HOSTNAME env is a common unix variable, and is set for things like
containers in a Kubernetes cluster. This means that if you are using a
file for config, the hostname in the config will be ignored and replaced
with the machine or container name. This was not the intention.

We should clarify the name of the environment variable we are looking
for to `TARGET_HOSTNAME` to avoid this conflict.
  • Loading branch information
alexblackie committed Nov 10, 2022
1 parent 32ea055 commit d33dbb2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func LoadConfig(configPath string) (*Config, error) {
}
}

if value, exists := os.LookupEnv("HOSTNAME"); exists {
if value, exists := os.LookupEnv("TARGET_HOSTNAME"); exists {
config.Hostname = value
}

Expand Down

0 comments on commit d33dbb2

Please sign in to comment.