Skip to content

Commit

Permalink
[Ingest Manager] Do not compare err with custom type (#19980) (#19982)
Browse files Browse the repository at this point in the history
* fix error comparison in enroll
  • Loading branch information
michalpristas committed Jul 16, 2020
1 parent a57b6ef commit 67f4d61
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions x-pack/elastic-agent/CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,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

Expand Down
2 changes: 1 addition & 1 deletion x-pack/elastic-agent/pkg/agent/cmd/enroll.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...")
Expand Down

0 comments on commit 67f4d61

Please sign in to comment.