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

API refactor: implements delete agent rpc #1692

Merged
merged 4 commits into from
Jul 2, 2020

Conversation

MarcosDY
Copy link
Collaborator

@MarcosDY MarcosDY commented Jul 1, 2020

Implements delete agent rpc, and update delete attested node on datastore to remove relationships

Which issue this PR fixes
fixes #1636

Signed-off-by: Marcos Yacob <marcos.yacob@hpe.com>
Copy link
Member

@azdagron azdagron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few small nits

return nil, status.Error(codes.NotFound, "agent not found")
default:
log.WithError(err).Error("Failed to remove Agent")
return nil, status.Errorf(codes.Internal, "failed to remove Agent: %v", err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return nil, status.Errorf(codes.Internal, "failed to remove Agent: %v", err)
return nil, status.Errorf(codes.Internal, "failed to remove agent: %v", err)

log.WithError(err).Error("Agent not found")
return nil, status.Error(codes.NotFound, "agent not found")
default:
log.WithError(err).Error("Failed to remove Agent")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log.WithError(err).Error("Failed to remove Agent")
log.WithError(err).Error("Failed to remove agent")

Signed-off-by: Marcos Yacob <marcos.yacob@hpe.com>
ds: ds,
logHook: logHook,
}
if tt.dsError != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we could remove the if and just setting a nil next error

err: "not an agent ID",
req: &agentpb.DeleteAgentRequest{
Id: &types.SPIFFEID{
TrustDomain: "examples.org",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TrustDomain: "examples.org",
TrustDomain: "example.org",

Signed-off-by: Marcos Yacob <marcos.yacob@hpe.com>
Copy link
Member

@azdagron azdagron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\o/

@azdagron azdagron merged commit ea7ac6f into spiffe:master Jul 2, 2020
@MarcosDY MarcosDY deleted the api-refactor-delete-agent branch August 2, 2022 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API Refactor: Implement Agent.DeleteAgent RPC
3 participants