plumb policy-override flag to the CLI (#5826)
This commit is contained in:
parent
2686fd3791
commit
08ca544273
|
@ -38,16 +38,17 @@ type BaseCommand struct {
|
|||
flags *FlagSets
|
||||
flagsOnce sync.Once
|
||||
|
||||
flagAddress string
|
||||
flagCACert string
|
||||
flagCAPath string
|
||||
flagClientCert string
|
||||
flagClientKey string
|
||||
flagNamespace string
|
||||
flagNS string
|
||||
flagTLSServerName string
|
||||
flagTLSSkipVerify bool
|
||||
flagWrapTTL time.Duration
|
||||
flagAddress string
|
||||
flagCACert string
|
||||
flagCAPath string
|
||||
flagClientCert string
|
||||
flagClientKey string
|
||||
flagNamespace string
|
||||
flagNS string
|
||||
flagPolicyOverride bool
|
||||
flagTLSServerName string
|
||||
flagTLSSkipVerify bool
|
||||
flagWrapTTL time.Duration
|
||||
|
||||
flagFormat string
|
||||
flagField string
|
||||
|
@ -135,6 +136,9 @@ func (c *BaseCommand) Client() (*api.Client, error) {
|
|||
if c.flagNamespace != notSetValue {
|
||||
client.SetNamespace(namespace.Canonicalize(c.flagNamespace))
|
||||
}
|
||||
if c.flagPolicyOverride {
|
||||
client.SetPolicyOverride(c.flagPolicyOverride)
|
||||
}
|
||||
|
||||
c.client = client
|
||||
|
||||
|
@ -293,6 +297,14 @@ func (c *BaseCommand) flagSet(bit FlagSetBit) *FlagSets {
|
|||
"transmissions to and from the Vault server.",
|
||||
})
|
||||
|
||||
f.BoolVar(&BoolVar{
|
||||
Name: "policy-override",
|
||||
Target: &c.flagPolicyOverride,
|
||||
Default: false,
|
||||
Usage: "Override a Sentinel policy that has a soft-mandatory " +
|
||||
"enforcement_level specified",
|
||||
})
|
||||
|
||||
f.DurationVar(&DurationVar{
|
||||
Name: "wrap-ttl",
|
||||
Target: &c.flagWrapTTL,
|
||||
|
|
Loading…
Reference in New Issue