kubeadm: Fix subtle versioning ordering issue with v1.8.0-alpha.0

This commit is contained in:
Lucas Käldström 2017-06-13 16:17:13 +03:00
parent 5d2dbb58d7
commit 97ea818cc8
No known key found for this signature in database
GPG Key ID: 3FA3783D77751514
2 changed files with 6 additions and 2 deletions

View File

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

View File

@ -254,7 +254,9 @@ func deletePermissiveNodesBindingWhenUsingNodeAuthorization(clientset *clientset
// If the server version is higher than the Node Authorizer's minimum, try to delete the Group=system:nodes->ClusterRole=system:node binding
// which is much more permissive than the Node Authorizer
if k8sVersion.AtLeast(kubeadmconstants.MinimumNodeAuthorizerVersion) {
// TODO: That we have to exclude v1.8.0-alpha.0 here is based on the way kubernetes branches work
// v1.7.0-beta.0 == v1.8.0.alpha.0 but they are sorted/compared differently
if k8sVersion.AtLeast(kubeadmconstants.MinimumNodeAuthorizerVersion) && cfg.KubernetesVersion != "v1.8.0-alpha.0" {
nodesRoleBinding, err := clientset.RbacV1beta1().ClusterRoleBindings().Get(kubeadmconstants.NodesClusterRoleBinding, metav1.GetOptions{})
if err != nil {