consul/agent/hcp
Melissa Kam 7900544249
[CC-7063] Fetch HCP agent bootstrap config in Link reconciler (#20306)
* Move config-dependent methods to separate package

In order to reuse the fetching and file creation part of the
bootstrap package, move the code that would cause cyclical
dependencies to a different package.

* Export needed bootstrap methods and variables

Also add back validating persisted config and update tests.

* Add support to check for just management token

Add a new method that fetches the bootstrap configuration only if
there isn't a valid management token file instead of checking for
all the hcp-config files.

* Pass data dir as a dependency to link controller

The link controller needs to check the data directory for
the hcp-config files.

* Fetch bootstrap config for token in controller

Load the management token when reconciling a link resource, which will
fetch the agent boostrap configuration if the token is not already
persisted locally. Skip this step if the cluster is in read-only mode.

* Validate resource ID format in link creation

* Handle unauthorized and forbidden errors

Check for 401 and 403s when making GNM requests, exit bootstrap fetch
loop and return specific failure statuses for link.

* Move test function to a testing file

* Log load and status write errors
2024-01-24 09:51:43 -06:00
..
bootstrap [CC-7063] Fetch HCP agent bootstrap config in Link reconciler (#20306) 2024-01-24 09:51:43 -06:00
client [CC-7063] Fetch HCP agent bootstrap config in Link reconciler (#20306) 2024-01-24 09:51:43 -06:00
config [CC-7031] Add initialization support to resource controllers (#20138) 2024-01-19 11:47:48 -06:00
discover [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
scada [CC-7041] Update and start the SCADA provider in HCP manager (#19976) 2024-01-08 09:49:29 -06:00
telemetry Fix flaky test (#18805) 2023-09-14 16:46:47 +00:00
testserver [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
deps.go [CC-7063] Fetch HCP agent bootstrap config in Link reconciler (#20306) 2024-01-24 09:51:43 -06:00
deps_test.go [HCP Telemetry] Move first TelemetryConfig Fetch into the TelemetryConfigProvider (#18318) 2023-08-30 13:25:26 -04:00
manager.go Create HCP management token in HCP manager (#19830) 2024-01-19 13:58:49 -05:00
manager_test.go Create HCP management token in HCP manager (#19830) 2024-01-19 13:58:49 -05:00
telemetry_provider.go [CC-7042] Update and enable the HCP metrics sink in the HCP manager (#20072) 2024-01-16 10:46:12 -06:00
telemetry_provider_test.go [CC-7042] Update and enable the HCP metrics sink in the HCP manager (#20072) 2024-01-16 10:46:12 -06:00
testing.go [Cloud][CC-6925] Updates to pushing server state (#19682) 2023-12-04 10:25:18 -05:00