Merge pull request #15526 from influxdata/4447/fix_vault_flag_names

fix(vault): rename flags to match env vars and add missing token flag
pull/15529/head
Johnny Steenbergen 2019-10-21 16:15:57 -07:00 committed by GitHub
commit 1e69c517b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 4 deletions

View File

@ -196,7 +196,7 @@ func buildLauncherCommand(l *Launcher, cmd *cobra.Command) {
},
{
DestP: &vaultConfig.Address,
Flag: "vault-address",
Flag: "vault-addr",
Desc: "address of the Vault server expressed as a URL and port, for example: https://127.0.0.1:8200/.",
},
{
@ -206,17 +206,17 @@ func buildLauncherCommand(l *Launcher, cmd *cobra.Command) {
},
{
DestP: &vaultConfig.MaxRetries,
Flag: "vault-client-max-retries",
Flag: "vault-max-retries",
Desc: "maximum number of retries when a 5xx error code is encountered. The default is 2, for three total attempts. Set this to 0 or less to disable retrying.",
},
{
DestP: &vaultConfig.CACert,
Flag: "vault-ca-cert",
Flag: "vault-cacert",
Desc: "path to a PEM-encoded CA certificate file on the local disk. This file is used to verify the Vault server's SSL certificate. This environment variable takes precedence over VAULT_CAPATH.",
},
{
DestP: &vaultConfig.CAPath,
Flag: "vault-ca-path",
Flag: "vault-capath",
Desc: "path to a directory of PEM-encoded CA certificate files on the local disk. These certificates are used to verify the Vault server's SSL certificate.",
},
{
@ -239,6 +239,11 @@ func buildLauncherCommand(l *Launcher, cmd *cobra.Command) {
Flag: "vault-tls-server-name",
Desc: "name to use as the SNI host when connecting via TLS.",
},
{
DestP: &vaultConfig.Token,
Flag: "vault-token",
Desc: "vault authentication token",
},
{
DestP: &l.httpTlsCert,
Flag: "tls-cert",

View File

@ -25,6 +25,7 @@ type Config struct {
AgentAddress string
ClientTimeout time.Duration
MaxRetries int
Token string
TLSConfig
}
@ -114,6 +115,10 @@ func NewSecretService(cfgOpts ...ConfigOptFn) (*SecretService, error) {
return nil, err
}
if explicitConfig.Token != "" {
c.SetToken(explicitConfig.Token)
}
return &SecretService{
Client: c,
}, nil