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

Use GetByPrefix to find nodes when approving/rejecting them #3681

Merged
merged 1 commit into from
Mar 23, 2024
Merged
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
8 changes: 4 additions & 4 deletions pkg/node/manager/node_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ func (n *NodeManager) Delete(ctx context.Context, nodeID string) error {
// reason for the approval (for audit). The return values denote success and any
// failure of the operation as a human readable string.
func (n *NodeManager) Approve(ctx context.Context, nodeID string, reason string) (bool, string) {
info, err := n.nodeInfo.Get(ctx, nodeID)
info, err := n.nodeInfo.GetByPrefix(ctx, nodeID)
if err != nil {
return false, "node not found"
return false, err.Error()
}

if info.Approval == models.NodeApprovals.APPROVED {
Expand All @@ -213,9 +213,9 @@ func (n *NodeManager) Approve(ctx context.Context, nodeID string, reason string)
// reason for the rejection (for audit). The return values denote success and any
// failure of the operation as a human readable string.
func (n *NodeManager) Reject(ctx context.Context, nodeID string, reason string) (bool, string) {
info, err := n.nodeInfo.Get(ctx, nodeID)
info, err := n.nodeInfo.GetByPrefix(ctx, nodeID)
if err != nil {
return false, "node not found"
return false, err.Error()
}

if info.Approval == models.NodeApprovals.REJECTED {
Expand Down
Loading