From a99dd82929013249c8f57f1867da8a8ed4fb93d9 Mon Sep 17 00:00:00 2001 From: Jeremy Jacobson Date: Thu, 20 Jul 2023 09:42:28 -0700 Subject: [PATCH] Apply suggestions from code review Co-authored-by: lornasong --- .changelog/18140.txt | 2 +- agent/hcp/bootstrap/bootstrap.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.changelog/18140.txt b/.changelog/18140.txt index e02ab33bceb2..fabd9fc2916b 100644 --- a/.changelog/18140.txt +++ b/.changelog/18140.txt @@ -1,3 +1,3 @@ ```release-note:improvement -cloud: Removes requirement for HCP to provide a management token +hcp: Removes requirement for HCP to provide a management token ``` diff --git a/agent/hcp/bootstrap/bootstrap.go b/agent/hcp/bootstrap/bootstrap.go index 320b36107313..191859ea002b 100644 --- a/agent/hcp/bootstrap/bootstrap.go +++ b/agent/hcp/bootstrap/bootstrap.go @@ -298,6 +298,8 @@ func persistAndProcessConfig(dataDir string, devMode bool, bsCfg *hcpclient.Boot return "", fmt.Errorf("failed to persist bootstrap config: %w", err) } + // HCP only returns the management token if it requires Consul to + // initialize it if bsCfg.ManagementToken != "" { if err := validateManagementToken(bsCfg.ManagementToken); err != nil { return "", fmt.Errorf("invalid management token: %w", err)