adding -dev-kv-v1 flag for forcing kvv1 (#5919)

This commit is contained in:
Chris Hoffman 2018-12-12 15:07:18 -05:00 committed by Brian Kassouf
parent d86acfc94f
commit 555b914695
1 changed files with 10 additions and 2 deletions

View File

@ -94,6 +94,7 @@ type ServerCommand struct {
flagDevLatency int
flagDevLatencyJitter int
flagDevLeasedKV bool
flagDevKVV1 bool
flagDevSkipInit bool
flagDevThreeNode bool
flagDevFourCluster bool
@ -250,6 +251,13 @@ func (c *ServerCommand) Flags() *FlagSets {
Hidden: true,
})
f.BoolVar(&BoolVar{
Name: "dev-kv-v1",
Target: &c.flagDevKVV1,
Default: false,
Hidden: true,
})
f.BoolVar(&BoolVar{
Name: "dev-auto-seal",
Target: &c.flagDevAutoSeal,
@ -356,7 +364,7 @@ func (c *ServerCommand) Run(args []string) int {
allLoggers := []log.Logger{c.logger}
// Automatically enable dev mode if other dev flags are provided.
if c.flagDevHA || c.flagDevTransactional || c.flagDevLeasedKV || c.flagDevThreeNode || c.flagDevFourCluster || c.flagDevAutoSeal {
if c.flagDevHA || c.flagDevTransactional || c.flagDevLeasedKV || c.flagDevThreeNode || c.flagDevFourCluster || c.flagDevAutoSeal || c.flagDevKVV1 {
c.flagDev = true
}
@ -1334,7 +1342,7 @@ func (c *ServerCommand) enableDev(core *vault.Core, coreConfig *vault.CoreConfig
}
// Upgrade the default K/V store
if !c.flagDevLeasedKV {
if !c.flagDevLeasedKV && !c.flagDevKVV1 {
req := &logical.Request{
Operation: logical.UpdateOperation,
ClientToken: init.RootToken,