consul/agent/hcp/client
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
..
client.go [CC-7063] Fetch HCP agent bootstrap config in Link reconciler (#20306) 2024-01-24 09:51:43 -06:00
client_test.go Sync cluster attributes from GNM to Link resource (#20158) 2024-01-19 10:02:55 -05:00
errors.go [CC-7063] Fetch HCP agent bootstrap config in Link reconciler (#20306) 2024-01-24 09:51:43 -06:00
http_client.go [CC-7042] Update and enable the HCP metrics sink in the HCP manager (#20072) 2024-01-16 10:46:12 -06:00
http_client_test.go [CC-7042] Update and enable the HCP metrics sink in the HCP manager (#20072) 2024-01-16 10:46:12 -06:00
metrics_client.go [CC-7042] Update and enable the HCP metrics sink in the HCP manager (#20072) 2024-01-16 10:46:12 -06:00
metrics_client_test.go [CC-7042] Update and enable the HCP metrics sink in the HCP manager (#20072) 2024-01-16 10:46:12 -06:00
mock_Client.go Sync cluster attributes from GNM to Link resource (#20158) 2024-01-19 10:02:55 -05:00
telemetry_config.go [HCP Telemetry] Move first TelemetryConfig Fetch into the TelemetryConfigProvider (#18318) 2023-08-30 13:25:26 -04:00
telemetry_config_test.go [HCP Telemetry] Move first TelemetryConfig Fetch into the TelemetryConfigProvider (#18318) 2023-08-30 13:25:26 -04:00