From d826dee18e9a9412fa8664258fcee6cc0880cefe Mon Sep 17 00:00:00 2001 From: Pier-Hugues Pellerin Date: Fri, 17 Apr 2020 09:22:35 -0400 Subject: [PATCH] [Agent] Rename the User-Agent string from Beats Agent to Elastic Agent (#17765) * Rename the User-Agent string from Beats Agent to Elastic Agent When we changed the name of the agent to Elastic Agent we forgot to update the User-Agent string send on every request. --- x-pack/elastic-agent/CHANGELOG.asciidoc | 2 +- x-pack/elastic-agent/pkg/fleetapi/client_test.go | 4 ++-- x-pack/elastic-agent/pkg/fleetapi/round_trippers.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/elastic-agent/CHANGELOG.asciidoc b/x-pack/elastic-agent/CHANGELOG.asciidoc index 6ce888c26fc..aa84ada1acf 100644 --- a/x-pack/elastic-agent/CHANGELOG.asciidoc +++ b/x-pack/elastic-agent/CHANGELOG.asciidoc @@ -18,11 +18,11 @@ - Fixed merge of config {pull}17399[17399] - Handle abs paths on windows correctly {pull}17461[17461] - Improved cancellation of agent {pull}17318[17318] +- Rename the User-Agent string from Beats Agent to Elastic Agent. {pull}17765[17765] - Fix issues when running `mage package` for all the platforms. {pull}17767[17767] - Remove the kbn-version on each request to the Kibana API. {pull}17764[17764] - Fixed process spawning on Windows {pull}17751[17751] - ==== New features - Generate index name in a format type-dataset-namespace {pull}16903[16903] diff --git a/x-pack/elastic-agent/pkg/fleetapi/client_test.go b/x-pack/elastic-agent/pkg/fleetapi/client_test.go index 5766fe109a6..416ff9dcc49 100644 --- a/x-pack/elastic-agent/pkg/fleetapi/client_test.go +++ b/x-pack/elastic-agent/pkg/fleetapi/client_test.go @@ -76,14 +76,14 @@ func TestHTTPClient(t *testing.T) { }, )) - t.Run("Fleet user agent", withServer( + t.Run("Elastic Agent User-Agent string", withServer( func(t *testing.T) *http.ServeMux { msg := `{ message: "hello" }` mux := http.NewServeMux() mux.HandleFunc("/echo-hello", func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) fmt.Fprintf(w, msg) - require.Equal(t, r.Header.Get("User-Agent"), "Beat Agent v8.0.0") + require.Equal(t, r.Header.Get("User-Agent"), "Elastic Agent v8.0.0") }) return mux }, func(t *testing.T, host string) { diff --git a/x-pack/elastic-agent/pkg/fleetapi/round_trippers.go b/x-pack/elastic-agent/pkg/fleetapi/round_trippers.go index d163272e50d..d40da3bccdc 100644 --- a/x-pack/elastic-agent/pkg/fleetapi/round_trippers.go +++ b/x-pack/elastic-agent/pkg/fleetapi/round_trippers.go @@ -28,7 +28,7 @@ func (r *FleetUserAgentRoundTripper) RoundTrip(req *http.Request) (*http.Respons // NewFleetUserAgentRoundTripper returns a FleetUserAgentRoundTripper that actually wrap the // existing UserAgentRoundTripper with a specific string. func NewFleetUserAgentRoundTripper(wrapped http.RoundTripper, version string) http.RoundTripper { - const name = "Beat Agent" + const name = "Elastic Agent" return &FleetUserAgentRoundTripper{ rt: kibana.NewUserAgentRoundTripper(wrapped, name+" v"+version), }