mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 02:02:43 +00:00
add noop ent supported storage check (#17883)
This commit is contained in:
@@ -78,9 +78,8 @@ const (
|
||||
|
||||
// Even though there are more types than the ones below, the following consts
|
||||
// are declared internally for value comparison and reusability.
|
||||
storageTypeRaft = "raft"
|
||||
storageTypeConsul = "consul"
|
||||
disableStorageTypeCheckEnv = "VAULT_DISABLE_SUPPORTED_STORAGE_CHECK"
|
||||
storageTypeRaft = "raft"
|
||||
storageTypeConsul = "consul"
|
||||
)
|
||||
|
||||
type ServerCommand struct {
|
||||
@@ -1413,7 +1412,13 @@ func (c *ServerCommand) Run(args []string) int {
|
||||
// Apply any enterprise configuration onto the coreConfig.
|
||||
adjustCoreConfigForEnt(config, &coreConfig)
|
||||
|
||||
if !c.flagDev && os.Getenv(disableStorageTypeCheckEnv) == "" {
|
||||
if !storageSupportedForEnt(&coreConfig) {
|
||||
c.UI.Warn("")
|
||||
c.UI.Warn(wrapAtLength(fmt.Sprintf("WARNING: storage configured to use %q which is not supported for Vault Enterprise, must be \"raft\" or \"consul\"", coreConfig.StorageType)))
|
||||
c.UI.Warn("")
|
||||
}
|
||||
|
||||
if !c.flagDev {
|
||||
inMemStorageTypes := []string{
|
||||
"inmem", "inmem_ha", "inmem_transactional", "inmem_transactional_ha",
|
||||
}
|
||||
@@ -1422,12 +1427,6 @@ func (c *ServerCommand) Run(args []string) int {
|
||||
c.UI.Warn("")
|
||||
c.UI.Warn(wrapAtLength(fmt.Sprintf("WARNING: storage configured to use %q which should NOT be used in production", coreConfig.StorageType)))
|
||||
c.UI.Warn("")
|
||||
} else {
|
||||
err = checkStorageTypeForEnt(&coreConfig)
|
||||
if err != nil {
|
||||
c.UI.Error(fmt.Sprintf("Invalid storage type: %s", err))
|
||||
return 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
var (
|
||||
adjustCoreConfigForEnt = adjustCoreConfigForEntNoop
|
||||
checkStorageTypeForEnt = checkStorageTypeForEntNoop
|
||||
storageSupportedForEnt = checkStorageTypeForEntNoop
|
||||
)
|
||||
|
||||
func adjustCoreConfigForEntNoop(config *server.Config, coreConfig *vault.CoreConfig) {
|
||||
@@ -19,6 +19,6 @@ func getFIPSInfoKeyNoop() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func checkStorageTypeForEntNoop(coreConfig *vault.CoreConfig) error {
|
||||
return nil
|
||||
func checkStorageTypeForEntNoop(coreConfig *vault.CoreConfig) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user