Skip to content

Commit

Permalink
Fix key upgrade and raft tests (#6949)
Browse files Browse the repository at this point in the history
  • Loading branch information
briankassouf authored and jefferai committed Jun 21, 2019
1 parent 490bc0f commit eb13427
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vault/logical_system.go
Original file line number Diff line number Diff line change
Expand Up @@ -2380,8 +2380,9 @@ func (b *SystemBackend) handleRotate(ctx context.Context, req *logical.Request,
}

// Schedule the destroy of the upgrade path
time.AfterFunc(keyRotateGracePeriod, func() {
if err := b.Core.barrier.DestroyUpgrade(ctx, newTerm); err != nil {
time.AfterFunc(KeyRotateGracePeriod, func() {
b.Backend.Logger().Debug("cleaning up upgrade keys", "waited", KeyRotateGracePeriod)
if err := b.Core.barrier.DestroyUpgrade(b.Core.activeContext, newTerm); err != nil {
b.Backend.Logger().Error("failed to destroy upgrade", "term", newTerm, "error", err)
}
})
Expand Down
1 change: 1 addition & 0 deletions vault/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,7 @@ func NewTestCluster(t testing.T, base *CoreConfig, opts *TestClusterOptions) *Te
coreConfig.DevLicenseDuration = base.DevLicenseDuration
coreConfig.DisableCache = base.DisableCache
coreConfig.LicensingConfig = base.LicensingConfig
coreConfig.DisablePerformanceStandby = base.DisablePerformanceStandby
if base.BuiltinRegistry != nil {
coreConfig.BuiltinRegistry = base.BuiltinRegistry
}
Expand Down

0 comments on commit eb13427

Please sign in to comment.