-
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
refactor certificate controller to break it into two parts #45514
Conversation
219be60
to
887d43b
Compare
Looks good so far. Will you continue the pattern from the GKESigner of adding events to the CSR on these different failure conditions? Would be very useful to trace/diagnose cluster issues. Also, is the end goal to pull these out into completely different processes, or just separate goroutines in the controller-manager? |
@pipejakob that's a good idea. I'm going to encorporate it in a follow up. |
Cool. Are you looking for a stronger LGTM before restoring the tests, or are you set for now? |
Not yet. Sorry. |
Will ping explicitly. |
@pipejakob this is ready for final review. I partially restored controller_test.go but a lot of what it is testing is duplicated in cfssl_signer_test.go, so I didn't reinclude that. PTAL. |
@k8s-bot pull-kubernetes-federation-e2e-gce test this |
Federation failure looks to be tracked in #45978. |
*/ | ||
|
||
// Package certificates contains logic for watching and synchronizing | ||
// CertificateSigningRequests. |
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.
With this file gone, and a lot of the code being moved into two new packages, they could each use their own package-level godoc (either inline in an existing file, or a doc.go
file).
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.
Added godoc to the packages.
|
||
import ( | ||
"testing" | ||
|
||
certificates "k8s.io/kubernetes/pkg/apis/certificates/v1beta1" | ||
api "k8s.io/kubernetes/pkg/apis/certificates/v1beta1" | ||
) | ||
|
||
func TestHasKubeletUsages(t *testing.T) { |
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 only tests I can see here are for the hasExactUsages()
helper, but not for the main groupapprover code: handle()
and autoApprove()
. I would have expected more tests to break with this refactoring; is code coverage just really low here? Can you punch it up as part of this refactoring?
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 added a bunch of test in #45619 for this.
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.
Ah, I hadn't even seen #45619. I'll take a look.
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.
Mostly LGTM, just a few minor comments.
@pipejakob federation is not a blocking build. I think I addressed all comments. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mikedanese, pipejakob
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
@k8s-bot pull-kubernetes-e2e-gce-etcd3 test this |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue (batch tested with PRs 45514, 45635) |
@mikedanese: The following test(s) failed:
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
Automatic merge from submit-queue (batch tested with PRs 46635, 45619, 46637, 45059, 46415) migrate group approver to use subject access reviews WIP, needs test and changes to kubeadm depends on #45514
Break pkg/controller/certificates into: