Skip to content

Commit 97ea818

Browse files
committed
kubeadm: Fix subtle versioning ordering issue with v1.8.0-alpha.0
1 parent 5d2dbb5 commit 97ea818

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

cmd/kubeadm/app/master/manifests.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,9 @@ func getAPIServerCommand(cfg *kubeadmapi.MasterConfiguration, selfHosted bool, k
355355
defaultArguments["proxy-client-cert-file"] = filepath.Join(cfg.CertificatesDir, kubeadmconstants.FrontProxyClientCertName)
356356
defaultArguments["proxy-client-key-file"] = filepath.Join(cfg.CertificatesDir, kubeadmconstants.FrontProxyClientKeyName)
357357
}
358-
if k8sVersion.AtLeast(kubeadmconstants.MinimumNodeAuthorizerVersion) {
358+
// TODO: That we have to exclude v1.8.0-alpha.0 here is based on the way kubernetes branches work
359+
// v1.7.0-beta.0 == v1.8.0.alpha.0 but they are sorted/compared differently
360+
if k8sVersion.AtLeast(kubeadmconstants.MinimumNodeAuthorizerVersion) && cfg.KubernetesVersion != "v1.8.0-alpha.0" {
359361
// enable the NodeRestriction admission plugin
360362
defaultArguments["admission-control"] = defaultv17AdmissionControl
361363
}

cmd/kubeadm/app/phases/apiconfig/clusterroles.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,9 @@ func deletePermissiveNodesBindingWhenUsingNodeAuthorization(clientset *clientset
254254

255255
// If the server version is higher than the Node Authorizer's minimum, try to delete the Group=system:nodes->ClusterRole=system:node binding
256256
// which is much more permissive than the Node Authorizer
257-
if k8sVersion.AtLeast(kubeadmconstants.MinimumNodeAuthorizerVersion) {
257+
// TODO: That we have to exclude v1.8.0-alpha.0 here is based on the way kubernetes branches work
258+
// v1.7.0-beta.0 == v1.8.0.alpha.0 but they are sorted/compared differently
259+
if k8sVersion.AtLeast(kubeadmconstants.MinimumNodeAuthorizerVersion) && cfg.KubernetesVersion != "v1.8.0-alpha.0" {
258260

259261
nodesRoleBinding, err := clientset.RbacV1beta1().ClusterRoleBindings().Get(kubeadmconstants.NodesClusterRoleBinding, metav1.GetOptions{})
260262
if err != nil {

0 commit comments

Comments
 (0)