Skip to content

Commit df00f2f

Browse files
committed
remove deprecated experimental-cert-rotation, use enable-client-cert-rotation instead
1 parent 385fd21 commit df00f2f

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

cmd/kubeadm/app/cmd/phases/init/kubeletfinalize.go

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ var (
3939
# Updates settings relevant to the kubelet after TLS bootstrap"
4040
kubeadm init phase kubelet-finalize all --config
4141
`)
42-
// TODO: remove with 'experimental-cert-rotation'.
43-
// https://github.com/kubernetes/kubeadm/issues/3046
44-
enableClientCertRotationRun = false
4542
)
4643

4744
// NewKubeletFinalizePhase creates a kubeadm workflow phase that updates settings
@@ -65,43 +62,14 @@ func NewKubeletFinalizePhase() workflow.Phase {
6562
InheritFlags: []string{options.CfgPath, options.CertificatesDir, options.DryRun},
6663
Run: runKubeletFinalizeEnableClientCertRotation,
6764
},
68-
// TODO: remove this phase in 1.32.
69-
// also remove the "enableClientCertRotationRun" variable.
70-
// https://github.com/kubernetes/kubeadm/issues/3046
71-
{
72-
Name: "experimental-cert-rotation",
73-
Short: "Enable kubelet client certificate rotation (DEPRECATED: use 'enable-client-cert-rotation' instead)",
74-
InheritFlags: []string{options.CfgPath, options.CertificatesDir, options.DryRun},
75-
Run: runKubeletFinalizeEnableClientCertRotationWrapped,
76-
},
7765
},
7866
}
7967
}
8068

81-
// runKubeletFinalizeEnableClientCertRotationWrapped wraps runKubeletFinalizeEnableClientCertRotation
82-
// and prints a deprecation message when the phase is executed directly. If 'all' is used this
83-
// function should just return nil because 'enable-client-cert-rotation' sets 'enableClientCertRotationRun'.
84-
// TODO: remove in 1.32.
85-
// https://github.com/kubernetes/kubeadm/issues/3046
86-
func runKubeletFinalizeEnableClientCertRotationWrapped(c workflow.RunData) error {
87-
if enableClientCertRotationRun {
88-
return nil
89-
}
90-
klog.Warning("The phase 'experimental-cert-rotation' is deprecated and will be removed in a future release. " +
91-
"Use 'enable-client-cert-rotation' instead")
92-
return runKubeletFinalizeEnableClientCertRotation(c)
93-
}
94-
9569
// runKubeletFinalizeEnableClientCertRotation detects if the kubelet certificate rotation is enabled
9670
// and updates the kubelet.conf file to point to a rotatable certificate and key for the
9771
// Node user.
9872
func runKubeletFinalizeEnableClientCertRotation(c workflow.RunData) error {
99-
// Set 'enableClientCertRotationRun' to make sure that if 'all' is called,
100-
// runKubeletFinalizeEnableClientCertRotationWrapped will return nil early.
101-
// TODO: remove in 1.32.
102-
// https://github.com/kubernetes/kubeadm/issues/3046
103-
enableClientCertRotationRun = true
104-
10573
data, ok := c.(InitData)
10674
if !ok {
10775
return errors.New("kubelet-finalize phase invoked with an invalid data struct")

0 commit comments

Comments
 (0)