consul/agent
Nick Cellino 5fb6ab6a3a
Move HCP Manager lifecycle management out of Link controller (#20401)
* Add function to get update channel for watching HCP Link

* Add MonitorHCPLink function

This function can be called in a goroutine to manage the lifecycle
of the HCP manager.

* Update HCP Manager config in link monitor before starting

This updates HCPMonitorLink so it updates the HCP manager
with an HCP client and management token when a Link is upserted.

* Let MonitorHCPManager handle lifecycle instead of link controller

* Remove cleanup from Link controller and move it to MonitorHCPLink

Previously, the Link Controller was responsible for cleaning up the
HCP-related files on the file system. This change makes it so
MonitorHCPLink handles this cleanup. As a result, we are able to remove
the PlacementEachServer placement strategy for the Link controller
because it no longer needs to do this per-node cleanup.

* Remove HCP Manager dependency from Link Controller

The Link controller does not need to have HCP Manager
as a dependency anymore, so this removes that dependency
in order to simplify the design.

* Add Linked prefix to Linked status variables

This is in preparation for adding a new status type to the
Link resource.

* Add new "validated" status type to link resource

The link resource controller will now set a "validated" status
in addition to the "linked" status. This is needed so that other
components (eg the HCP manager) know when the Link is ready to link
with HCP.

* Fix tests

* Handle new 'EndOfSnapshot' WatchList event

* Fix watch test

* Remove unnecessary config from TestAgent_scadaProvider

Since the Scada provider is now started on agent startup
regardless of whether a cloud config is provided, this removes
the cloud config override from the relevant test.

This change is not exactly related to the changes from this PR,
but rather is something small and sort of related that was noticed
while working on this PR.

* Simplify link watch test and remove sleep from link watch

This updates the link watch test so that it uses more mocks
and does not require setting up the infrastructure for the HCP Link
controller.

This also removes the time.Sleep delay in the link watcher loop in favor
of an error counter. When we receive 10 consecutive errors, we shut down
the link watcher loop.

* Add better logging for link validation. Remove EndOfSnapshot test.

* Refactor link monitor test into a table test

* Add some clarifying comments to link monitor

* Simplify link watch test

* Test a bunch more errors cases in link monitor test

* Use exponential backoff instead of errorCounter in LinkWatch

* Move link watch and link monitor into a single goroutine called from server.go

* Refactor HCP link watcher to use single go-routine.

Previously, if the WatchClient errored, we would've never recovered
because we never retry to create the stream. With this change,
we have a single goroutine that runs for the life of the server agent
and if the WatchClient stream ever errors, we retry the creation
of the stream with an exponential backoff.
2024-02-12 10:48:23 -05:00
..
ae server: when the v2 catalog experiment is enabled reject api and rpc requests that are for the v1 catalog (#19129) 2023-10-11 10:44:03 -05:00
auto-config [NET-6593] agent: check for minimum RSA key size (#20112) 2024-01-10 12:15:36 +00:00
blockingquery [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
cache xds controller: setup watches for and compute leaf cert references in ProxyStateTemplate, and wire up leaf cert manager dependency (#18756) 2023-09-12 12:56:43 -07:00
cache-types xds controller: setup watches for and compute leaf cert references in ProxyStateTemplate, and wire up leaf cert manager dependency (#18756) 2023-09-12 12:56:43 -07:00
cacheshim xds controller: setup watches for and compute leaf cert references in ProxyStateTemplate, and wire up leaf cert manager dependency (#18756) 2023-09-12 12:56:43 -07:00
checks Remove old build tags (#19128) 2023-10-10 10:58:06 -04:00
config Add default intention policy (#20544) 2024-02-08 20:25:42 +00:00
configentry Hash based config entry replication (#19795) 2023-12-12 08:29:13 -05:00
connect [NET-6593] agent: check for minimum RSA key size (#20112) 2024-01-10 12:15:36 +00:00
consul Move HCP Manager lifecycle management out of Link controller (#20401) 2024-02-12 10:48:23 -05:00
debug [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
discovery feat(v2dns): catalog v2 service query support (#20564) 2024-02-09 17:41:40 -05:00
dns feat(v2dns): catalog v2 service query support (#20564) 2024-02-09 17:41:40 -05:00
envoyextensions NET-6946 / NET-6941 - Replace usage of deprecated Envoy fields envoy.config.route.v3.HeaderMatcher.safe_regex_match and envoy.type.matcher.v3.RegexMatcher.google_re2 (#20013) 2024-01-03 09:53:39 -07:00
exec Remove old build tags (#19128) 2023-10-10 10:58:06 -04:00
grpc-external feat(v2dns): catalog v2 workload query support (#20466) 2024-02-02 18:29:38 -05:00
grpc-internal In-Memory gRPC (#19942) 2024-01-12 11:54:07 -05:00
grpc-middleware resource: add MutateAndValidate endpoint (#20311) 2024-01-25 13:12:30 -06:00
hcp Move HCP Manager lifecycle management out of Link controller (#20401) 2024-02-12 10:48:23 -05:00
leafcert xds controller: setup watches for and compute leaf cert references in ProxyStateTemplate, and wire up leaf cert manager dependency (#18756) 2023-09-12 12:56:43 -07:00
local bug: prevent go routine leakage due to existing DeferCheck (#18558) 2023-08-23 10:33:07 -04:00
log-drop [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
metadata [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
metrics [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
mock [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
pool [NET-6459] Fix issue with wanfed lan ip conflicts. (#19503) 2023-11-06 08:47:12 -06:00
proxycfg Fix to not create a watch to `Internal.ServiceDump` when mesh gateway is not used (#20168) 2024-01-18 16:44:53 -06:00
proxycfg-glue Add default intention policy (#20544) 2024-02-08 20:25:42 +00:00
proxycfg-sources [NET-5916] Fix locality-aware routing config and tests (CE) (#19483) 2023-11-02 14:05:06 -05:00
router [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
routine-leak-checker [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
rpc Panic for unregistered types (#20476) 2024-02-06 11:23:06 -05:00
rpcclient OSS -> CE (community edition) changes (#18517) 2023-08-22 09:46:03 -05:00
structs Add default intention policy (#20544) 2024-02-08 20:25:42 +00:00
submatview [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
systemd [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
token Remove old build tags (#19128) 2023-10-10 10:58:06 -04:00
uiserver NET-5398: Update UI server to include if v2 is enabled (#20353) 2024-01-26 14:38:51 -07:00
xds add traffic permissions excludes and tests (#20453) 2024-02-07 20:21:44 +00:00
xdsv2 add traffic permissions excludes and tests (#20453) 2024-02-07 20:21:44 +00:00
acl.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
acl_ce.go Remove old build tags (#19128) 2023-10-10 10:58:06 -04:00
acl_endpoint.go [NET-6249] Add templated policies description (#19735) 2023-11-27 10:34:22 -05:00
acl_endpoint_test.go Various race condition and test fixes. (#20212) 2024-01-16 08:57:43 -06:00
acl_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
agent.go Add default intention policy (#20544) 2024-02-08 20:25:42 +00:00
agent_ce.go Remove old build tags (#19128) 2023-10-10 10:58:06 -04:00
agent_ce_test.go Remove old build tags (#19128) 2023-10-10 10:58:06 -04:00
agent_endpoint.go Add default intention policy (#20544) 2024-02-08 20:25:42 +00:00
agent_endpoint_ce.go Remove old build tags (#19128) 2023-10-10 10:58:06 -04:00
agent_endpoint_ce_test.go Remove old build tags (#19128) 2023-10-10 10:58:06 -04:00
agent_endpoint_test.go Add default intention policy (#20544) 2024-02-08 20:25:42 +00:00
agent_test.go Move HCP Manager lifecycle management out of Link controller (#20401) 2024-02-12 10:48:23 -05:00
apiserver.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
apiserver_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
catalog_endpoint.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
catalog_endpoint_ce.go Remove old build tags (#19128) 2023-10-10 10:58:06 -04:00
catalog_endpoint_test.go Retry lint fixes (#19151) 2023-12-06 12:11:32 -05:00
check.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
config_endpoint.go NET-5824 Exported services api (#20015) 2024-01-23 10:06:59 +05:30
config_endpoint_test.go Fix issue with persisting proxy-defaults (#20481) 2024-02-05 16:00:19 -06:00
connect_ca_endpoint.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
connect_ca_endpoint_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
coordinate_endpoint.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
coordinate_endpoint_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
delegate_mock_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
denylist.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
denylist_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
discovery_chain_endpoint.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
discovery_chain_endpoint_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
dns.go feat(v2dns): add PTR query support (#20362) 2024-01-29 11:40:10 -05:00
dns_ce.go DNS v2 - add virtual ip questions (#20245) 2024-01-17 23:46:18 +00:00
dns_ce_test.go set up ent and CE specific DNS tests to be able to run v1 and v2 (#20571) 2024-02-09 15:53:56 -07:00
dns_node_lookup_test.go DNS v2 Multiple fixes. (#20525) 2024-02-07 21:24:00 -07:00
dns_service_lookup_test.go feat(v2dns): prepared query ttls (#20563) 2024-02-09 11:26:02 -05:00
dns_test.go NET-7637 / NET-7659/NET-7636/NET-7647/NET-7648/NET-7646/NET-7649/NET-7645 - Multiple DNS v2 fixes (#20556) 2024-02-08 19:56:04 -07:00
enterprise_delegate_ce.go Remove old build tags (#19128) 2023-10-10 10:58:06 -04:00
event_endpoint.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
event_endpoint_test.go Retry lint fixes (#19151) 2023-12-06 12:11:32 -05:00
federation_state_endpoint.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
health_endpoint.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
health_endpoint_test.go Retry lint fixes (#19151) 2023-12-06 12:11:32 -05:00
http.go Fix audit-log encoding issue (CC-7337) (#20345) 2024-02-06 16:40:07 +05:30
http_ce.go Fix audit-log encoding issue (CC-7337) (#20345) 2024-02-06 16:40:07 +05:30
http_ce_test.go OSS -> CE (community edition) changes (#18517) 2023-08-22 09:46:03 -05:00
http_decode_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
http_register.go NET-5824 Exported services api (#20015) 2024-01-23 10:06:59 +05:30
http_test.go Retry lint fixes (#19151) 2023-12-06 12:11:32 -05:00
intentions_endpoint.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
intentions_endpoint_ce_test.go Remove old build tags (#19128) 2023-10-10 10:58:06 -04:00
intentions_endpoint_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
keyring.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
keyring_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
kvs_endpoint.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
kvs_endpoint_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
metrics.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
metrics_test.go Various race condition and test fixes. (#20212) 2024-01-16 08:57:43 -06:00
nodeid.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
nodeid_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
notify.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
notify_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
operator_endpoint.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
operator_endpoint_ce.go Remove old build tags (#19128) 2023-10-10 10:58:06 -04:00
operator_endpoint_ce_test.go Remove old build tags (#19128) 2023-10-10 10:58:06 -04:00
operator_endpoint_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
peering_endpoint.go OSS -> CE (community edition) changes (#18517) 2023-08-22 09:46:03 -05:00
peering_endpoint_ce_test.go Remove old build tags (#19128) 2023-10-10 10:58:06 -04:00
peering_endpoint_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
prepared_query_endpoint.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
prepared_query_endpoint_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
proxycfg_test.go catalog,mesh,auth: Move resource types to the proto-public module (#18935) 2023-09-22 15:50:56 -06:00
reload.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
remote_exec.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
remote_exec_test.go Retry lint fixes (#19151) 2023-12-06 12:11:32 -05:00
retry_join.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
retry_join_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
service_checks_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
service_manager.go Ensure that upstream configuration is properly normalized. (#19076) 2023-10-06 13:59:47 -05:00
service_manager_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
session_endpoint.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
session_endpoint_test.go Retry lint fixes (#19151) 2023-12-06 12:11:32 -05:00
setup.go [CC-7044] Start HCP manager as part of link creation (#20312) 2024-01-29 16:31:44 -06:00
setup_ce.go Remove old build tags (#19128) 2023-10-10 10:58:06 -04:00
sidecar_service.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
sidecar_service_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
signal_unix.go Remove old build tags (#19128) 2023-10-10 10:58:06 -04:00
signal_windows.go Remove old build tags (#19128) 2023-10-10 10:58:06 -04:00
snapshot_endpoint.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
snapshot_endpoint_test.go Fix more test flakes (#19533) 2023-11-07 10:15:50 -06:00
status_endpoint.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
status_endpoint_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
streaming_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
testagent.go Various race condition and test fixes. (#20212) 2024-01-16 08:57:43 -06:00
testagent_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
translate_addr.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
txn_endpoint.go Add TCP+TLS Healthchecks (#18381) 2023-09-05 13:34:44 -07:00
txn_endpoint_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
ui_endpoint.go [NET-5688] APIGateway UI Topology Fixes (#19657) 2023-11-28 21:27:14 +00:00
ui_endpoint_ce_test.go Remove old build tags (#19128) 2023-10-10 10:58:06 -04:00
ui_endpoint_test.go server: when the v2 catalog experiment is enabled reject api and rpc requests that are for the v1 catalog (#19129) 2023-10-11 10:44:03 -05:00
user_event.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
user_event_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
util.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
util_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
watch_handler.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
watch_handler_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00