mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
vault: configure user agent on Nomad vault clients (#15745)
* vault: configure user agent on Nomad vault clients This PR attempts to set the User-Agent header on each Vault API client created by Nomad. Still need to figure a way to set User-Agent on the Vault client created internally by consul-template. * vault: fixup find-and-replace gone awry
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
|
||||
"github.com/hashicorp/nomad/ci"
|
||||
"github.com/hashicorp/nomad/helper/testlog"
|
||||
"github.com/hashicorp/nomad/helper/useragent"
|
||||
"github.com/hashicorp/nomad/helper/uuid"
|
||||
"github.com/hashicorp/nomad/nomad/structs/config"
|
||||
vapi "github.com/hashicorp/vault/api"
|
||||
@@ -57,6 +58,7 @@ func NewTestVaultFromPath(t testing.T, binary string) *TestVault {
|
||||
t.Fatalf("failed to build Vault API client: %v", err)
|
||||
}
|
||||
client.SetToken(token)
|
||||
useragent.SetHeaders(client)
|
||||
|
||||
enable := true
|
||||
tv := &TestVault{
|
||||
@@ -133,6 +135,7 @@ func NewTestVaultDelayed(t testing.T) *TestVault {
|
||||
t.Fatalf("failed to build Vault API client: %v", err)
|
||||
}
|
||||
client.SetToken(token)
|
||||
useragent.SetHeaders(client)
|
||||
|
||||
enable := true
|
||||
tv := &TestVault{
|
||||
|
||||
Reference in New Issue
Block a user