Cluster-api: Add utility function for getting and extracting the cluster kubeconfig

Created on 22 Aug 2019  路  12Comments  路  Source: kubernetes-sigs/cluster-api

Describe the solution you'd like

As a follow-up to #1301 (comment), it was suggested that the functionality in clusterclient for getting and extracting a kubeconfig for given cluster were made available in util/kubeconfig/kubeconfig.go.

Naming-wise this could be called something like Fetch, but that's left up to the implementer.

Anything else you would like to add:

/kind feature

good first issue help wanted kinfeature

Most helpful comment

@kashifest I believe that @vincepri was suggesting that we keep the GetKubeconfigFromSecret method in clusterclient.go, but have it simply call the newly created utility method.

I would expect these two methods to have slightly different signatures as well, with the new utility method requiring a client to be passed in as a parameter.

All 12 comments

/help
/good-first-issue

@vincepri:
This request has been marked as suitable for new contributors.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.

In response to this:

/help
/good-first-issue

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

If no one has taken this up yet, I would like to work on this issue. I have recently started contributing and this might be a good issue to get started.

I would be interested to work on this issue. I would like to take it if it is ok with others.

@prankul88 would you want to pair with @kashifest on this?

@ncdc Sure I will :) Thanks

Thanks @ncdc, me and @prankul88 have started working on it!

@joonas and @vincepri . We have a question. From the issue description and discussion in #1301 what we understand that the ' GetKubeconfigFromSecret' method should be also inside 'kubeconfig.go'. That means the same method will be in two places?

@kashifest I believe that @vincepri was suggesting that we keep the GetKubeconfigFromSecret method in clusterclient.go, but have it simply call the newly created utility method.

I would expect these two methods to have slightly different signatures as well, with the new utility method requiring a client to be passed in as a parameter.

Thanks for the clarification @detiber

/assign @kashifest

@kashifest you'll also want to make sure that your pull request has this the master branch of this repository as the base so that it can be merged to the correct repository.

Was this page helpful?
0 / 5 - 0 ratings