From a6239adf767d9a5ebf43fe98be9b987e6ee4f210 Mon Sep 17 00:00:00 2001 From: James Rasell Date: Thu, 2 Nov 2023 08:19:04 +0000 Subject: [PATCH] cli: remove unused raft tool helper. (#18954) (#18971) --- 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 281589f6f..7ef2c1387 100644 --- a/ci/test-core.json +++ b/ci/test-core.json @@ -27,7 +27,6 @@ "client/structs/...", "client/taskenv/...", "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 a8938331b..000000000 --- a/command/raft_tools/state.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -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 -}