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

[v17] Remove the original unpaginated GetRoles RPC #48002

Merged
merged 2 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
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
20 changes: 0 additions & 20 deletions api/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1782,11 +1782,6 @@ func (c *Client) GetRoles(ctx context.Context) ([]types.Role, error) {
for {
rsp, err := c.ListRoles(ctx, &req)
if err != nil {
if trace.IsNotImplemented(err) {
// fallback to calling the old non-paginated role API.
roles, err = c.getRoles(ctx)
return roles, trace.Wrap(err)
}
return nil, trace.Wrap(err)
}

Expand All @@ -1802,21 +1797,6 @@ func (c *Client) GetRoles(ctx context.Context) ([]types.Role, error) {
return roles, nil
}

// getRoles calls the old non-paginated GetRoles method.
//
// DELETE IN 17.0
func (c *Client) getRoles(ctx context.Context) ([]types.Role, error) {
resp, err := c.grpc.GetRoles(ctx, &emptypb.Empty{})
if err != nil {
return nil, trace.Wrap(err)
}
roles := make([]types.Role, 0, len(resp.GetRoles()))
for _, role := range resp.GetRoles() {
roles = append(roles, role)
}
return roles, nil
}

// ListRoles is a paginated role getter.
func (c *Client) ListRoles(ctx context.Context, req *proto.ListRolesRequest) (*proto.ListRolesResponse, error) {
var header gmetadata.MD
Expand Down
Loading
Loading