Skip to content

Commit

Permalink
add support for vault-transport-max-conns-per-host
Browse files Browse the repository at this point in the history
  • Loading branch information
ccapurso committed Jan 2, 2024
1 parent 6c70796 commit c2d9cef
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,11 @@ func (cli *CLI) ParseFlags(args []string) (
return nil
}), "vault-transport-max-idle-conns-per-host", "")

flags.Var((funcIntVar)(func(i int) error {
c.Vault.Transport.MaxConnsPerHost = config.Int(i)
return nil
}), "vault-transport-max-conns-per-host", "")

flags.Var((funcDurationVar)(func(d time.Duration) error {
c.Vault.Transport.TLSHandshakeTimeout = config.TimeDuration(d)
return nil
Expand Down Expand Up @@ -920,6 +925,9 @@ Options:
-vault-transport-max-idle-conns-per-host=<int>
Sets the maximum number of idle connections to permit per host
-vault-transport-max-conns-per-host=<int>
Sets the maximum number of total connections to permit per host
-vault-transport-tls-handshake-timeout=<duration>
Sets the handshake timeout
Expand Down
12 changes: 12 additions & 0 deletions cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,18 @@ func TestCLI_ParseFlags(t *testing.T) {
},
false,
},
{
"vault-transport-max-conns-per-host",
[]string{"-vault-transport-max-conns-per-host", "25"},
&config.Config{
Vault: &config.VaultConfig{
Transport: &config.TransportConfig{
MaxConnsPerHost: config.Int(25),
},
},
},
false,
},
{
"vault-transport-tls-handshake-timeout",
[]string{"-vault-transport-tls-handshake-timeout", "30s"},
Expand Down

0 comments on commit c2d9cef

Please sign in to comment.