Skip to content

Commit

Permalink
[agent] support get agent endpoint from ENV ENDPOINT
Browse files Browse the repository at this point in the history
  • Loading branch information
taomaree committed Aug 13, 2017
1 parent 0dc420a commit 5b6a8b2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/agent/g/cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ func Hostname() (string, error) {
return hostname, nil
}

if os.Getenv("ENDPOINT") != "" {
hostname = os.Getenv("ENDPOINT")
return hostname, nil
}

hostname, err := os.Hostname()
if err != nil {
log.Println("ERROR: os.Hostname() fail", err)
Expand Down

0 comments on commit 5b6a8b2

Please sign in to comment.