-
Notifications
You must be signed in to change notification settings - Fork 40k
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
kubeadm: Replace *clientset.Clientset with clientset.Interface #50162
kubeadm: Replace *clientset.Clientset with clientset.Interface #50162
Conversation
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.
It's not a blocker but I like the kubernetes.Interface naming.
@@ -193,7 +193,7 @@ func NewCmdTokenGenerate(out io.Writer) *cobra.Command { | |||
} | |||
|
|||
// 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 { |
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.
fwiw I explicitly call it kubernetes.Interface vs. using the internal vernacular b/c it's easier for new folks to understand.
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.
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
/lgtm /approve |
/approve no-issue |
[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 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
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.
yay generic interfaces!
Automatic merge from submit-queue (batch tested with PRs 47416, 47408, 49697, 49860, 50162) |
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:
@timothysc @dmmcquay @pipejakob