27 Commits

Author SHA1 Message Date
Chris Roberts
4b9597a31d [agent] Fix error checking within retry join (#26434)
The `RetryJoin` function checks for an error and logs it before
retrying. The error variables were shadowed which resulted in
the errors never being logged. This predefines the variables
to prevent them from being shadowed.

The testlog package was also updated to support providing a custom
writer which allows logging output to be easily caught and inspected.
2025-08-26 14:18:12 -07:00
James Rasell
61b2b9d3d0 agent: Improve retry joiner code with small refactor. (#25422)
The agent retry joiner implementation had different parameters
to control its execution for agents running in server and client
mode. The agent would set up individual joiners depending on the
agent mode, making the object parameter overhead unrequired.

This change removes the excess configuration options for the
joiner, reducing code complexity slighly and hopefully making
future modifications in this area easier to make.
2025-03-18 15:55:52 +00:00
James Rasell
261359fba7 agent: Fix a bug where retry_join was not retrying. (#24561)
The retry_join logic was not allowing for retries to happen and
was exiting after the first failed discovery attempt. This change
fixes that behaviour and adds a test to ensure no further
regressions.
2024-11-29 08:29:15 +00:00
Adriano Caloiaro
f66eb83fc0 Add go-netaddrs support to retry_join (#18745) 2023-11-15 10:07:18 -05:00
hashicorp-copywrite[bot]
a9d61ea3fd Update copyright file headers to BUSL-1.1 2023-08-10 17:27:29 -05:00
hashicorp-copywrite[bot]
f005448366 [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
Piotr Kazmierczak
949a6f60c7 renamed stanza to block for consistency with other projects (#15941) 2023-01-30 15:48:43 +01:00
Alex Dadgar
40d095fd1a agent + consul 2018-09-13 10:43:40 -07:00
Alex Dadgar
2dde49e2bf Improve validation/defaulting, handle start-join
This commit:
* Improves how we combine the old retry-* fields and the new stanza and
how it is validated
* Handles the new stanza setting start_join
* Fixes integration test to not bind to the standard port and instead be
randomized.
* Simplifies parsing of the old retry_interval
* Fixes the errors from retry join being masked
* Flags get parsed into new server_join stanza
2018-05-31 10:53:26 -07:00
Alex Dadgar
13f8e91e35 validation errors 2018-05-31 10:53:26 -07:00
Chelsea Holland Komlo
4b20a698ac ensure default value of 30s is set for server_join stanza 2018-05-31 10:50:04 -07:00
Chelsea Holland Komlo
3d12b3fdf2 ignore default values for retry interval
add additional validation case
2018-05-31 10:50:04 -07:00
Chelsea Holland Komlo
94cf42ec81 update config parse test
documentation fixes
2018-05-31 10:50:04 -07:00
Chelsea Holland Komlo
fa1d2de5df RetryInterval should be a time.Duration 2018-05-31 10:50:04 -07:00
Chelsea Holland Komlo
023cc2c3b7 set retryInterval and other code feedback 2018-05-31 10:50:04 -07:00
Chelsea Holland Komlo
b4a0f2cc8c add further configuration validation for server_join 2018-05-31 10:50:04 -07:00
Chelsea Holland Komlo
0770f03031 update documentation for server_join 2018-05-31 10:50:04 -07:00
Chelsea Holland Komlo
02b89ae0f4 update server_join naming and improve logging 2018-05-31 10:50:03 -07:00
Chelsea Holland Komlo
1a854c444e add server join info to server and client 2018-05-31 10:50:03 -07:00
Chelsea Holland Komlo
321b0779d5 only write error log line on error 2018-05-07 16:57:07 -04:00
Chelsea Holland Komlo
496b5cce38 remove log line for empty addresses which could confuse on initalization 2018-05-07 16:57:07 -04:00
Chelsea Holland Komlo
d00e096073 retry until all options are exhausted 2018-05-07 16:57:07 -04:00
Chelsea Holland Komlo
9e78d227e5 ensure provider= is always the string prefix 2018-05-07 16:57:07 -04:00
Chelsea Holland Komlo
f34d76a7ed update test for more realistic IP address from go-discover 2018-05-07 16:57:07 -04:00
Chelsea Holland Komlo
0d3c6a0441 comments and other fixups 2018-05-07 16:57:06 -04:00
Chelsea Holland Komlo
1e3bb6b21d add go-discover 2018-05-07 16:57:06 -04:00
Chelsea Holland Komlo
5b7027d9ec refactor to retryJoiner interface 2018-05-07 16:57:06 -04:00