Skip to content

kubeadm: Replace *clientset.Clientset with clientset.Interface#50162

Merged
k8s-github-robot merged 1 commit intokubernetes:masterfrom
luxas:kubeadm_clientset_iface
Aug 5, 2017
Merged

kubeadm: Replace *clientset.Clientset with clientset.Interface#50162
k8s-github-robot merged 1 commit intokubernetes:masterfrom
luxas:kubeadm_clientset_iface

Conversation

@luxas
Copy link
Copy Markdown
Member

@luxas luxas commented Aug 4, 2017

What this PR does / why we need it:

Needed for #48899
We should always use clientset.Interface instead of *clientset.Clientset, for better testability and all the other benefits of using an interface.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:
Should be straightforward to merge

Release note:

NONE

@timothysc @dmmcquay @pipejakob

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 4, 2017
@k8s-github-robot k8s-github-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. release-note-none Denotes a PR that doesn't merit a release note. labels Aug 4, 2017
@timothysc timothysc added the sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. label Aug 4, 2017
@timothysc timothysc added this to the v1.8 milestone Aug 4, 2017
Copy link
Copy Markdown
Contributor

@timothysc timothysc left a comment

Choose a reason for hiding this comment

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

It's not a blocker but I like the kubernetes.Interface naming.


// RunCreateToken generates a new bootstrap token and stores it as a secret on the server.
func RunCreateToken(out io.Writer, client *clientset.Clientset, token string, tokenDuration time.Duration, usages []string, description string) error {
func RunCreateToken(out io.Writer, client clientset.Interface, token string, tokenDuration time.Duration, usages []string, description string) error {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

fwiw I explicitly call it kubernetes.Interface vs. using the internal vernacular b/c it's easier for new folks to understand.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

SGTM, we should probably rename a couple of other imports as well, like kubeadmconstants to just constants etc. However, not a priority for me rn

@timothysc timothysc added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Aug 4, 2017
@timothysc
Copy link
Copy Markdown
Contributor

/lgtm

/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 4, 2017
@timothysc
Copy link
Copy Markdown
Contributor

/approve no-issue

@k8s-github-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: luxas, timothysc

No associated issue. Update pull-request body to add a reference to an issue, or get approval with /approve no-issue

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@timothysc timothysc added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 4, 2017
Copy link
Copy Markdown
Contributor

@MHBauer MHBauer left a comment

Choose a reason for hiding this comment

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

yay generic interfaces!

@k8s-github-robot
Copy link
Copy Markdown

Automatic merge from submit-queue (batch tested with PRs 47416, 47408, 49697, 49860, 50162)

@k8s-github-robot k8s-github-robot merged commit bb99ccc into kubernetes:master Aug 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants