Skip to content

Commit

Permalink
Re-add error for loading HCP management token
Browse files Browse the repository at this point in the history
  • Loading branch information
jjacobson93 committed Jul 17, 2023
1 parent a8c6609 commit f1225f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion agent/hcp/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ func loadManagementToken(dir string) (string, error) {
bytes, err := os.ReadFile(name)
if os.IsNotExist(err) {
// A missing management token is not an error, if none was provided by HCP
return "", nil
return "", errors.New("configuration files on disk are incomplete, missing: " + name)
}
if err != nil {
return "", fmt.Errorf("failed to read: %w", err)
Expand Down
4 changes: 2 additions & 2 deletions agent/hcp/bootstrap/bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ func Test_loadPersistedBootstrapConfig(t *testing.T) {
existingCluster: true,
disableManagementToken: true,
expect: expect{
loaded: true,
loaded: false,
},
},
"existing cluster no files": {
Expand All @@ -398,7 +398,7 @@ func Test_loadPersistedBootstrapConfig(t *testing.T) {
"new cluster with no token": {
disableManagementToken: true,
expect: expect{
loaded: true,
loaded: false,
},
},
"new cluster some files": {
Expand Down

0 comments on commit f1225f5

Please sign in to comment.