-
Notifications
You must be signed in to change notification settings - Fork 14
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
Update tanzu
context APIs to support ClusterGroup
#142
Update tanzu
context APIs to support ClusterGroup
#142
Conversation
48120d8
to
5d84d5c
Compare
// ex: kubeconfig's cluster.server URL: https://endpoint/org/orgid/project/<projectName>/space/<spaceName> | ||
func GetKubeconfigForContext(contextName, projectName, spaceName string) ([]byte, error) { | ||
// Note: Specifying `spaceName` and `clusterGroupName` both at the same time is incorrect input. | ||
func GetKubeconfigForContext(contextName string, opts ...ResourceOptions) ([]byte, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function only supports getting kubeconfig for the tanzu
context-type and no other context type.
Should we consider renaming this function to be more specific like GetKubeconfigForTanzuContext
?
Or
Should we consider supporting the kubernetes
context-type and make this API more generic? cc @prkalle @vuil @marckhouzam
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does renaming cause a backwards compatibility problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially these methods were under tae
package and it was not an issue as user has to call them as tae.GetKubeconfigForContext
, but later due to renaming the context type to tanzu
and re-organizing them under config
package, it is causing confusion. So, i feel it is good to rename to avoid confusion. I believe these changes are breaking ( I see SetTanzuContextActiveResource()
signature also changed), so we can use this oppurtunity if possible (there should be only 2 affected plugins project
and space
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback @prkalle and @marckhouzam.
Does renaming cause a backwards compatibility problem?
I think all the APIs related to the tanzu
context are experimental APIs and we should be able to make changes to the API at the moment. Also, my existing changes do update the API signature as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will keep this thread open to get feedback from @vuil as well. However, I am not planning to do this rename as part of this PR. If we decide, I will create follow-up PR for the rename.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the idea of supporting the kubernetes context-type is interesting.
I'm not sure if it would be easy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest keeping the name look into add suport the kubernetes context-type in a followup, since the usecase for wanting to use this API for tanzu context is not that different from when context type is kubernetes. I also think it should be quite straightfoward to add this support.
fb79f95
to
450decc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes LGTM.
I would wait for others opinions regarding the discussion regarding renaming the method name GetKubeconfigForContext()
.
I am not planning to do any method name change as part of this PR. If we decide, I can create a follow-up PR to rename the method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
One nit about adding a extra test.
// ex: kubeconfig's cluster.server URL: https://endpoint/org/orgid/project/<projectName>/space/<spaceName> | ||
func GetKubeconfigForContext(contextName, projectName, spaceName string) ([]byte, error) { | ||
// Note: Specifying `spaceName` and `clusterGroupName` both at the same time is incorrect input. | ||
func GetKubeconfigForContext(contextName string, opts ...ResourceOptions) ([]byte, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the idea of supporting the kubernetes context-type is interesting.
I'm not sure if it would be easy.
What this PR does / why we need it
tanzu
context APIs to support ClusterGroupGetKubeconfigForContext
to make it more generalized. Users can pass resource options asopts
argument.Example usage of
GetKubeconfigForContext
:SetTanzuContextActiveResource
to make it more generalized that now takes theresourceInfo
object.Example usage of
SetTanzuContextActiveResource
:Which issue(s) this PR fixes
Fixes #143
Describe testing done for PR
Release note
Additional information
Special notes for your reviewer