From 0822af35af53e210efbb631111d333046430f9ec Mon Sep 17 00:00:00 2001 From: James Rasell Date: Thu, 2 Nov 2023 07:43:44 +0000 Subject: [PATCH] cli: remove unused raft tool helper. (#18954) --- ci/test-core.json | 1 - command/raft_tools/state.go | 29 ----------------------------- 2 files changed, 30 deletions(-) delete mode 100644 command/raft_tools/state.go diff --git a/ci/test-core.json b/ci/test-core.json index 1c64ee7cf..88808699a 100644 --- a/ci/test-core.json +++ b/ci/test-core.json @@ -29,7 +29,6 @@ "client/vaultclient/...", "client/widmgr/...", "command/agent/...", - "command/raft_tools/...", "command/ui/...", "helper/...", "internal/...", diff --git a/command/raft_tools/state.go b/command/raft_tools/state.go deleted file mode 100644 index 41b42a4dc..000000000 --- a/command/raft_tools/state.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 - -package rafttools - -import ( - "fmt" - - raftboltdb "github.com/hashicorp/raft-boltdb/v2" -) - -func RaftState(p string) (store *raftboltdb.BoltStore, firstIdx uint64, lastIdx uint64, err error) { - s, err := raftboltdb.NewBoltStore(p) - if err != nil { - return nil, 0, 0, fmt.Errorf("failed to open raft logs: %v", err) - } - - firstIdx, err = s.FirstIndex() - if err != nil { - return nil, 0, 0, fmt.Errorf("failed to fetch first index: %v", err) - } - - lastIdx, err = s.LastIndex() - if err != nil { - return nil, 0, 0, fmt.Errorf("failed to fetch last index: %v", err) - } - - return s, firstIdx, lastIdx, nil -}