Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Swenson committed Dec 22, 2023
1 parent c92f1bd commit 2e3e6bf
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 199 deletions.
13 changes: 0 additions & 13 deletions physical/raft/msgpack.go

This file was deleted.

6 changes: 0 additions & 6 deletions physical/raft/raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -904,9 +904,6 @@ type SetupOpts struct {
// RecoveryModeConfig is the configuration for the raft cluster in recovery
// mode.
RecoveryModeConfig *raft.Configuration

// overrideMsgpackUseNewTimeFormat is used for testing backwards compatability
overrideMsgpackUseNewTimeFormat *bool
}

func (b *RaftBackend) StartRecoveryCluster(ctx context.Context, peer Peer) error {
Expand Down Expand Up @@ -1008,9 +1005,6 @@ func (b *RaftBackend) SetupCluster(ctx context.Context, opts SetupOpts) error {
Logger: b.logger.Named("raft-net"),
MsgpackUseNewTimeFormat: true,
}
if opts.overrideMsgpackUseNewTimeFormat != nil {
transConfig.MsgpackUseNewTimeFormat = *opts.overrideMsgpackUseNewTimeFormat
}
transport := raft.NewNetworkTransportWithConfig(transConfig)

b.streamLayer = streamLayer
Expand Down
173 changes: 0 additions & 173 deletions physical/raft/raft_network_test.go

This file was deleted.

10 changes: 3 additions & 7 deletions physical/raft/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,16 @@ import (
)

func GetRaft(t testing.TB, bootstrap bool, noStoreState bool) (*RaftBackend, string) {
return GetRaftWithOpts(t, bootstrap, noStoreState, SetupOpts{})
}

func GetRaftWithOpts(t testing.TB, bootstrap bool, noStoreState bool, setupOpts SetupOpts) (*RaftBackend, string) {
raftDir, err := ioutil.TempDir("", "vault-raft-")
if err != nil {
t.Fatal(err)
}
t.Logf("raft dir: %s", raftDir)

return getRaftWithDir(t, bootstrap, noStoreState, raftDir, setupOpts)
return getRaftWithDir(t, bootstrap, noStoreState, raftDir)
}

func getRaftWithDir(t testing.TB, bootstrap bool, noStoreState bool, raftDir string, setupOpts SetupOpts) (*RaftBackend, string) {
func getRaftWithDir(t testing.TB, bootstrap bool, noStoreState bool, raftDir string) (*RaftBackend, string) {
id, err := uuid.GenerateUUID()
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -66,7 +62,7 @@ func getRaftWithDir(t testing.TB, bootstrap bool, noStoreState bool, raftDir str
t.Fatal(err)
}

err = backend.SetupCluster(context.Background(), setupOpts)
err = backend.SetupCluster(context.Background(), SetupOpts{})
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit 2e3e6bf

Please sign in to comment.