mirror of https://github.com/kubernetes/kops.git
Merge pull request #5621 from justinsb/validate_for_5459
Validate that require-kubeconfig is not passed after 1.10
This commit is contained in:
commit
fb0ab1b6af
|
|
@ -472,6 +472,16 @@ func ValidateCluster(c *kops.Cluster, strict bool) *field.Error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if kubernetesRelease.GTE(semver.MustParse("1.10.0")) {
|
||||||
|
// Flag removed in 1.10
|
||||||
|
if c.Spec.Kubelet.RequireKubeconfig != nil {
|
||||||
|
return field.Invalid(
|
||||||
|
kubeletPath.Child("requireKubeconfig"),
|
||||||
|
*c.Spec.Kubelet.RequireKubeconfig,
|
||||||
|
"require-kubeconfig flag was removed in 1.10. (Please be sure you are not using a cluster config from `kops get cluster --full`)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if c.Spec.Kubelet.BootstrapKubeconfig != "" {
|
if c.Spec.Kubelet.BootstrapKubeconfig != "" {
|
||||||
if c.Spec.KubeAPIServer == nil {
|
if c.Spec.KubeAPIServer == nil {
|
||||||
return field.Required(fieldSpec.Child("KubeAPIServer"), "bootstrap token require the NodeRestriction admissions controller")
|
return field.Required(fieldSpec.Child("KubeAPIServer"), "bootstrap token require the NodeRestriction admissions controller")
|
||||||
|
|
@ -501,6 +511,16 @@ func ValidateCluster(c *kops.Cluster, strict bool) *field.Error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if kubernetesRelease.GTE(semver.MustParse("1.10.0")) {
|
||||||
|
// Flag removed in 1.10
|
||||||
|
if c.Spec.MasterKubelet.RequireKubeconfig != nil {
|
||||||
|
return field.Invalid(
|
||||||
|
masterKubeletPath.Child("requireKubeconfig"),
|
||||||
|
*c.Spec.MasterKubelet.RequireKubeconfig,
|
||||||
|
"require-kubeconfig flag was removed in 1.10. (Please be sure you are not using a cluster config from `kops get cluster --full`)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if c.Spec.MasterKubelet.APIServers != "" && !isValidAPIServersURL(c.Spec.MasterKubelet.APIServers) {
|
if c.Spec.MasterKubelet.APIServers != "" && !isValidAPIServersURL(c.Spec.MasterKubelet.APIServers) {
|
||||||
return field.Invalid(masterKubeletPath.Child("APIServers"), c.Spec.MasterKubelet.APIServers, "Not a valid APIServer URL")
|
return field.Invalid(masterKubeletPath.Child("APIServers"), c.Spec.MasterKubelet.APIServers, "Not a valid APIServer URL")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue