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

core: add hook for initializing seals for migration #7666

Merged
merged 2 commits into from
Oct 15, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions command/server_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func adjustCoreForSealMigration(logger log.Logger, core *vault.Core, barrierSeal
var existSeal vault.Seal
var newSeal vault.Seal

// TODO(mjg): this prevents migration from/to the same seal type
mgaffney marked this conversation as resolved.
Show resolved Hide resolved
if existBarrierSealConfig.Type == barrierSeal.BarrierType() {
// In this case our migration seal is set so we are using it
// (potentially) for unwrapping. Set it on core for that purpose then
Expand Down
1 change: 1 addition & 0 deletions vault/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -1963,6 +1963,7 @@ func (c *Core) SetSealsForMigration(migrationSeal, newSeal, unwrapSeal Seal) {
c.seal = newSeal
c.seal.SetCore(c)
c.logger.Warn("entering seal migration mode; Vault will not automatically unseal even if using an autoseal", "from_barrier_type", c.migrationSeal.BarrierType(), "to_barrier_type", c.seal.BarrierType())
c.initSealsForMigration()
}
}

Expand Down
2 changes: 2 additions & 0 deletions vault/core_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,5 @@ func (c *Core) removeAllPerfStandbySecondaries() {}
func (c *Core) perfStandbyClusterHandler() (*replication.Cluster, *cache.Cache, chan struct{}, error) {
return nil, cache.New(2*cluster.HeartbeatInterval, 1*time.Second), make(chan struct{}), nil
}

func (c *Core) initSealsForMigration() {}