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

Add proto and implementations for GetServiceAccountNames #3894

Merged

Conversation

antgamdia
Copy link
Contributor

Description of the change

This is a prequel PR for #3883, mainly intended for generating all the resources, proto, implementation and API docs for the GetServiceAccountNames.
This operation just returns a list of service account names for a given authenticated user.

Benefits

We will be able to use this operation for retrieving the list of SAs when installing a package.

Possible drawbacks

N/A

Applicable issues

Additional information

I've also updated our API docs; as it is still a manual process... it forgot to do it in the previous release :S

Example:

image

Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
@@ -254,6 +255,34 @@ func (s *Server) GetResources(r *v1alpha1.GetResourcesRequest, stream v1alpha1.R
return nil
}

// GetResources returns the resources for an installed package.
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy-n-paste-o...

return nil, status.Errorf(codes.Internal, "unable to get the k8s client: '%v'", err)
}

saList, err := typedClient.CoreV1().ServiceAccounts(namespace).List(context.TODO(), metav1.ListOptions{})
Copy link
Contributor

Choose a reason for hiding this comment

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

We should be using the ctx that was passed in above, rather than creating a new context here?

Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
@antgamdia antgamdia merged commit 6d5b282 into vmware-tanzu:master Dec 3, 2021
@antgamdia antgamdia deleted the createGetServiceAccountNames branch December 3, 2021 07:53
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.

None yet

2 participants