From f7315be742422dda8d0adede6666b119761e67f4 Mon Sep 17 00:00:00 2001 From: Stanislav Chzhen Date: Thu, 12 Sep 2024 14:35:38 +0300 Subject: [PATCH] home: imp code --- internal/home/clients.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/home/clients.go b/internal/home/clients.go index 3a729a5b..60d7dafd 100644 --- a/internal/home/clients.go +++ b/internal/home/clients.go @@ -89,6 +89,16 @@ func (clients *clientsContainer) Init( confClients = append(confClients, p) } + // The clients.etcHosts may be nil even if config.Clients.Sources.HostsFile + // is true, because of the deprecated option --no-etc-hosts. + // + // TODO(e.burkov): The option should probably be returned, since hosts file + // currently used not only for clients' information enrichment, but also in + // the filtering module and upstream addresses resolution. + if !config.Clients.Sources.HostsFile { + etcHosts = nil + } + clients.storage, err = client.NewStorage(&client.Config{ AllowedTags: clientTags, InitialClients: confClients,