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

Fix key upgrade destroy and raft tests #6949

Merged
merged 1 commit into from
Jun 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 10 additions & 0 deletions vault/external_tests/raft/raft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ func TestRaft_ShamirUnseal(t *testing.T) {
})
coreConfig := &vault.CoreConfig{
Logger: logger,
// TODO: remove this later
DisablePerformanceStandby: true,
}
i := 0
cluster := vault.NewTestCluster(t, coreConfig, &vault.TestClusterOptions{
Expand Down Expand Up @@ -66,6 +68,8 @@ func TestRaft_SnapshotAPI(t *testing.T) {
})
coreConfig := &vault.CoreConfig{
Logger: logger,
// TODO: remove this later
DisablePerformanceStandby: true,
}
i := 0
cluster := vault.NewTestCluster(t, coreConfig, &vault.TestClusterOptions{
Expand Down Expand Up @@ -199,6 +203,8 @@ func TestRaft_SnapshotAPI_RekeyRotate_Backward(t *testing.T) {
})
coreConfig := &vault.CoreConfig{
Logger: logger,
// TODO: remove this later
DisablePerformanceStandby: true,
}
i := 0
cluster := vault.NewTestCluster(t, coreConfig, &vault.TestClusterOptions{
Expand Down Expand Up @@ -384,6 +390,8 @@ func TestRaft_SnapshotAPI_RekeyRotate_Forward(t *testing.T) {
})
coreConfig := &vault.CoreConfig{
Logger: logger,
// TODO: remove this later
DisablePerformanceStandby: true,
}
i := 0
cluster := vault.NewTestCluster(t, coreConfig, &vault.TestClusterOptions{
Expand Down Expand Up @@ -581,6 +589,8 @@ func TestRaft_SnapshotAPI_DifferentCluster(t *testing.T) {
})
coreConfig := &vault.CoreConfig{
Logger: logger,
// TODO: remove this later
DisablePerformanceStandby: true,
}
i := 0
cluster := vault.NewTestCluster(t, coreConfig, &vault.TestClusterOptions{
Expand Down
3 changes: 2 additions & 1 deletion vault/logical_system.go
Original file line number Diff line number Diff line change
Expand Up @@ -2389,7 +2389,8 @@ 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 {
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 @@ -1290,6 +1290,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