mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 03:27:54 +00:00
I think there was a plan at some point to support a "vault server -diagnose" command line option, but that doesn't seem to have ever come to pass. Removing the dead code. (#17983)
This commit is contained in:
@@ -140,7 +140,6 @@ type ServerCommand struct {
|
||||
flagTestServerConfig bool
|
||||
flagDevConsul bool
|
||||
flagExitOnCoreShutdown bool
|
||||
flagDiagnose string
|
||||
}
|
||||
|
||||
func (c *ServerCommand) Synopsis() string {
|
||||
@@ -223,19 +222,6 @@ func (c *ServerCommand) Flags() *FlagSets {
|
||||
"Using a recovery operation token, \"sys/raw\" API can be used to manipulate the storage.",
|
||||
})
|
||||
|
||||
// Disabled by default until functional
|
||||
if os.Getenv(OperatorDiagnoseEnableEnv) != "" {
|
||||
f.StringVar(&StringVar{
|
||||
Name: "diagnose",
|
||||
Target: &c.flagDiagnose,
|
||||
Default: notSetValue,
|
||||
Usage: "Run diagnostics before starting Vault. Specify a filename to direct output to that file.",
|
||||
})
|
||||
} else {
|
||||
// Ensure diagnose is *not* run when feature flag is off.
|
||||
c.flagDiagnose = notSetValue
|
||||
}
|
||||
|
||||
f = set.NewFlagSet("Dev Options")
|
||||
|
||||
f.BoolVar(&BoolVar{
|
||||
@@ -1063,21 +1049,6 @@ func (c *ServerCommand) Run(args []string) int {
|
||||
}
|
||||
}
|
||||
|
||||
if c.flagDiagnose != notSetValue {
|
||||
if c.flagDev {
|
||||
c.UI.Error("Cannot run diagnose on Vault in dev mode.")
|
||||
return 1
|
||||
}
|
||||
// TODO: add a file output flag to Diagnose
|
||||
diagnose := &OperatorDiagnoseCommand{
|
||||
BaseCommand: c.BaseCommand,
|
||||
flagDebug: false,
|
||||
flagSkips: []string{},
|
||||
flagConfigs: c.flagConfigs,
|
||||
}
|
||||
diagnose.RunWithParsedFlags()
|
||||
}
|
||||
|
||||
// Load the configuration
|
||||
var config *server.Config
|
||||
var err error
|
||||
|
||||
Reference in New Issue
Block a user