From f3e41f015c739d5b604a2ff7fe6c8dfd5d6447cc Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Thu, 16 Jul 2020 09:49:44 +0200 Subject: [PATCH 1/3] fix error comparison in enroll --- go.sum | 1 + x-pack/elastic-agent/pkg/agent/cmd/enroll.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/go.sum b/go.sum index 76e4a2e277a5..9fbe180245ad 100644 --- a/go.sum +++ b/go.sum @@ -222,6 +222,7 @@ github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/eclipse/paho.mqtt.golang v1.2.1-0.20200121105743-0d940dd29fd2 h1:DW6WrARxK5J+o8uAKCiACi5wy9EK1UzrsCpGBPsKHAA= github.com/eclipse/paho.mqtt.golang v1.2.1-0.20200121105743-0d940dd29fd2/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= +github.com/elastic/beats v7.6.2+incompatible h1:jHdLv83KURaqWUC6f55iMyVP6LYZrgElfeqxKWcskVE= github.com/elastic/dhcp v0.0.0-20200227161230-57ec251c7eb3 h1:lnDkqiRFKm0rxdljqrj3lotWinO9+jFmeDXIC4gvIQs= github.com/elastic/dhcp v0.0.0-20200227161230-57ec251c7eb3/go.mod h1:aPqzac6AYkipvp4hufTyMj5PDIphF3+At8zr7r51xjY= github.com/elastic/ecs v1.5.0 h1:/VEIBsRU4ecq2+U3RPfKNc6bFyomP6qnthYEcQZu8GU= diff --git a/x-pack/elastic-agent/pkg/agent/cmd/enroll.go b/x-pack/elastic-agent/pkg/agent/cmd/enroll.go index c7243926ced8..1c79ebdae8d1 100644 --- a/x-pack/elastic-agent/pkg/agent/cmd/enroll.go +++ b/x-pack/elastic-agent/pkg/agent/cmd/enroll.go @@ -122,7 +122,7 @@ func enroll(streams *cli.IOStreams, cmd *cobra.Command, flags *globalFlags, args backExp := backoff.NewExpBackoff(signal, 60*time.Second, 10*time.Minute) - for err == fleetapi.ErrTooManyRequests { + for errors.Is(err, fleetapi.ErrTooManyRequests) { fmt.Fprintln(streams.Out, "Too many requests on the remote server, will retry in a moment.") backExp.Wait() fmt.Fprintln(streams.Out, "Retrying to enroll...") From 74a66348b9dbe709fc5e7045d8fddb2af6eb5445 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Thu, 16 Jul 2020 09:50:30 +0200 Subject: [PATCH 2/3] mod --- go.sum | 1 - 1 file changed, 1 deletion(-) diff --git a/go.sum b/go.sum index 9fbe180245ad..76e4a2e277a5 100644 --- a/go.sum +++ b/go.sum @@ -222,7 +222,6 @@ github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/eclipse/paho.mqtt.golang v1.2.1-0.20200121105743-0d940dd29fd2 h1:DW6WrARxK5J+o8uAKCiACi5wy9EK1UzrsCpGBPsKHAA= github.com/eclipse/paho.mqtt.golang v1.2.1-0.20200121105743-0d940dd29fd2/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= -github.com/elastic/beats v7.6.2+incompatible h1:jHdLv83KURaqWUC6f55iMyVP6LYZrgElfeqxKWcskVE= github.com/elastic/dhcp v0.0.0-20200227161230-57ec251c7eb3 h1:lnDkqiRFKm0rxdljqrj3lotWinO9+jFmeDXIC4gvIQs= github.com/elastic/dhcp v0.0.0-20200227161230-57ec251c7eb3/go.mod h1:aPqzac6AYkipvp4hufTyMj5PDIphF3+At8zr7r51xjY= github.com/elastic/ecs v1.5.0 h1:/VEIBsRU4ecq2+U3RPfKNc6bFyomP6qnthYEcQZu8GU= From dc3ce9fbae2061b3e9e52c23be320ce0422ce549 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Thu, 16 Jul 2020 09:53:35 +0200 Subject: [PATCH 3/3] changelog --- x-pack/elastic-agent/CHANGELOG.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/elastic-agent/CHANGELOG.asciidoc b/x-pack/elastic-agent/CHANGELOG.asciidoc index e6b764fbc2af..170060ea4bff 100644 --- a/x-pack/elastic-agent/CHANGELOG.asciidoc +++ b/x-pack/elastic-agent/CHANGELOG.asciidoc @@ -49,6 +49,7 @@ - Properly stops subprocess on shutdown {pull}19567[19567] - Forward revision number of the configuration to the endpoint. {pull}19759[19759] - Remove support for logs type and use logfile {pull}19761[19761] +- Avoid comparing uncomparable types on enroll {issue}19976[19976] ==== New features