From e8afb8db469285608ee75d2f949fe5175cad2f68 Mon Sep 17 00:00:00 2001 From: Silvia Mitter Date: Tue, 13 Apr 2021 17:48:31 +0200 Subject: [PATCH] [elastic-agent] Use fleet.url for container cmd (#25026) Apply fleet server URL on startup if given. --- x-pack/elastic-agent/pkg/agent/cmd/container.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/x-pack/elastic-agent/pkg/agent/cmd/container.go b/x-pack/elastic-agent/pkg/agent/cmd/container.go index b926977f081..83ae0cf1039 100644 --- a/x-pack/elastic-agent/pkg/agent/cmd/container.go +++ b/x-pack/elastic-agent/pkg/agent/cmd/container.go @@ -317,6 +317,9 @@ func buildEnrollArgs(cfg setupConfig, token string, policyID string) ([]string, if cfg.FleetServer.CertKey != "" { args = append(args, "--fleet-server-cert-key", cfg.FleetServer.CertKey) } + if cfg.Fleet.URL != "" { + args = append(args, "--url", cfg.Fleet.URL) + } if cfg.FleetServer.InsecureHTTP { args = append(args, "--fleet-server-insecure-http") args = append(args, "--insecure")