From 536e6f3b3b68754cb9958f83e225e6f7d1565c08 Mon Sep 17 00:00:00 2001 From: Jeremy Jacobson Date: Wed, 19 Jul 2023 09:52:05 -0700 Subject: [PATCH] Remove extra validation line --- agent/hcp/bootstrap/bootstrap.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/agent/hcp/bootstrap/bootstrap.go b/agent/hcp/bootstrap/bootstrap.go index 29080d4b4643..320b36107313 100644 --- a/agent/hcp/bootstrap/bootstrap.go +++ b/agent/hcp/bootstrap/bootstrap.go @@ -354,12 +354,9 @@ func persistTLSCerts(dir string, serverCert, serverKey string, caCerts []string) return nil } -// Basic validation to ensure a UUID was loaded. +// Basic validation to ensure a UUID was loaded and assumes the token is non-empty func validateManagementToken(token string) error { - if token == "" { - return errors.New("missing HCP management token") - } - + // note: we assume that the token is not an empty string if _, err := uuid.ParseUUID(token); err != nil { return errors.New("management token is not a valid UUID") }