Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server/vault: tweak error messages #5228

Merged
merged 1 commit into from
Jan 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions nomad/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ OUTER:
retryTimer.Reset(v.config.ConnectionRetryIntv)
v.l.Lock()
v.connEstablished = true
v.connEstablishedErr = fmt.Errorf("Nomad Server failed to establish connections to Vault: %v", err)
v.connEstablishedErr = fmt.Errorf("failed to establish connection to Vault: %v", err)
v.l.Unlock()
continue OUTER
}
Expand Down Expand Up @@ -517,7 +517,8 @@ func (v *vaultClient) renewalLoop() {
if backoff < 0 {
// We have failed to renew the token past its expiration. Stop
// renewing with Vault.
v.logger.Error("failed to renew Vault token before lease expiration. Shutting down Vault client")
v.logger.Error("failed to renew Vault token before lease expiration. Shutting down Vault client",
"error", err)
v.l.Lock()
v.connEstablished = false
v.connEstablishedErr = err
Expand Down
2 changes: 1 addition & 1 deletion nomad/vault_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ func TestVaultClient_CreateToken_Role_InvalidToken(t *testing.T) {
task.Vault = &structs.Vault{Policies: []string{"default"}}

_, err = client.CreateToken(context.Background(), a, task.Name)
if err == nil || !strings.Contains(err.Error(), "Nomad Server failed to establish connections to Vault") {
if err == nil || !strings.Contains(err.Error(), "failed to establish connection to Vault") {
t.Fatalf("CreateToken should have failed: %v", err)
}
}
Expand Down