mirror of
https://github.com/hashicorp/vault.git
synced 2026-02-03 20:40:45 -05:00
When not in seal HA, do not use Rewrapped flag to trigger a seal re-wrap on start up. (#22668)
This commit is contained in:
parent
c8efa4c7a4
commit
a96a1a7346
2 changed files with 8 additions and 3 deletions
|
|
@ -2724,8 +2724,7 @@ func setSeal(c *ServerCommand, config *server.Config, infoKeys []string, info ma
|
|||
}
|
||||
|
||||
func (c *ServerCommand) computeSealGenerationInfo(existingSealGenInfo *vaultseal.SealGenerationInfo, sealConfigs []*configutil.KMS) (*vaultseal.SealGenerationInfo, error) {
|
||||
var generation uint64
|
||||
generation = 1
|
||||
generation := uint64(1)
|
||||
|
||||
if existingSealGenInfo != nil {
|
||||
if cmp.Equal(existingSealGenInfo.Seals, sealConfigs) {
|
||||
|
|
|
|||
|
|
@ -2397,8 +2397,14 @@ func (s standardUnsealStrategy) unseal(ctx context.Context, logger log.Logger, c
|
|||
return err
|
||||
}
|
||||
|
||||
if !sealGenerationInfo.IsRewrapped() {
|
||||
sealHaEnabled, err := server.IsSealHABetaEnabled()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if sealHaEnabled && !sealGenerationInfo.IsRewrapped() {
|
||||
// Flag migration performed for seal-rewrap later
|
||||
// Note that in the case where seal HA is not enabled, Core.migrateSeal() takes care of
|
||||
// triggering the rewrap when necessary.
|
||||
c.logger.Trace("seal generation information indicates that a seal-rewrap is needed", "generation", sealGenerationInfo.Generation, "rewrapped", sealGenerationInfo.IsRewrapped())
|
||||
atomic.StoreUint32(c.sealMigrationDone, 1)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue