Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding -dev-kv-v1 flag for forcing kvv1 in dev mode #5919

Merged
merged 1 commit into from
Dec 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ type ServerCommand struct {
flagDevLatency int
flagDevLatencyJitter int
flagDevLeasedKV bool
flagDevKVV1 bool
flagDevSkipInit bool
flagDevThreeNode bool
flagDevFourCluster bool
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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,
Expand Down