Re-add stored-shares for init and spit out a warning (#6677)

This commit is contained in:
Jeff Mitchell
2019-05-03 12:09:59 -04:00
committed by Brian Kassouf
parent cf2bdaaec4
commit 252aa1c528

View File

@@ -30,6 +30,7 @@ type OperatorInitCommand struct {
flagRecoveryShares int
flagRecoveryThreshold int
flagRecoveryPGPKeys []string
flagStoredShares int
// Consul
flagConsulAuto bool
@@ -139,6 +140,13 @@ func (c *OperatorInitCommand) Flags() *FlagSets {
"key.",
})
f.IntVar(&IntVar{
Name: "stored-shares",
Target: &c.flagStoredShares,
Default: -1,
Usage: "DEPRECATED: This flag does nothing. It will be removed in Vault 1.3.",
})
// Consul Options
f = set.NewFlagSet("Consul Options")
@@ -220,6 +228,10 @@ func (c *OperatorInitCommand) Run(args []string) int {
return 1
}
if c.flagStoredShares != -1 {
c.UI.Warn("-stored-shares has no effect and will be removed in Vault 1.3.\n")
}
// Build the initial init request
initReq := &api.InitRequest{
SecretShares: c.flagKeyShares,