-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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: Refactor renewal package #77780
Kubeadm: Refactor renewal package #77780
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fabriziopandini The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their 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.
thanks @fabriziopandini
that's a pretty big refactor and the new manager logic seems valid to me.
i think we should start allowing separate commits per PR, to make the review easier.
35af1f3
to
de02424
Compare
@neolit123 thanks for the review! |
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 @fabriziopandini !
Looks way better than before (especially for renewCertsByComponent
)!
Found a tiny nit at the first pass, but other than that, I'll try to do another pass tomorrow as the change is large.
cmd/kubeadm/app/cmd/alpha/certs.go
Outdated
kubeadmutil.CheckErr(err) | ||
// Get a renewal manager for a generic Cluster configuration, that is used only for getting | ||
// the list of certificates for building subcommands | ||
rm, _ := renewal.NewManager(&kubeadmapi.ClusterConfiguration{}, "") |
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.
Missing error check here?
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.
Actually, the error that is returned by NewManager
is not looked at anywhere.
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.
@rosti, good catch!
I somehow forgot to fix them
Now it is addressed
de02424
to
1c89787
Compare
/lgtm LGTM-ing here to unblock the work. |
Uhmm.. test seems stuck |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
the code implemented for managing renewal is getting more and more complex after detecting external CA and renewing kubeConfig. This PR refactors this code concentrating all the complexity into one package and making more transparent all the renewal internals to its consumers.
This refactor fixes also an inconsistency between
kubeadm alpha certs renew --csr-only
andkubeadm alpha certs renew
and sets the ground for implementing certs expiration checks in a cleaner and less invasive wayWhich issue(s) this PR fixes:
Rif kubernetes/kubeadm#1361
Rif kubernetes/kubeadm#1540
Does this PR introduce a user-facing change?:
/sig cluster-lifecycle
/area kubeadm
/priority important-soon
@kubernetes/sig-cluster-lifecycle-pr-reviews
/assign @rosti
/assign @timothysc