Skip to content

Commit

Permalink
squash: add comment for hostname file reading behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
ThinkChaos committed Aug 30, 2024
1 parent 9dcc90b commit d29cb66
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions resolver/query_logging_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ func (r *QueryLoggingResolver) writeLog(ctx context.Context) {
}

func readInstanceID(file string) (string, error) {
// Prefer /etc/hostname over os.Hostname to allow easy differenciation in a Docker Swarm
// See details in https://github.com/0xERR0R/blocky/pull/756
hn, fErr := os.ReadFile(file)
if fErr == nil {
return strings.TrimSpace(string(hn)), nil
Expand Down

0 comments on commit d29cb66

Please sign in to comment.