Skip to content

Commit

Permalink
Merge pull request #13016 from olemarkus/automated-cherry-pick-of-#13…
Browse files Browse the repository at this point in the history
…011-origin-release-1.21

Automated cherry pick of #13011: Prevent creation of unsupported etcd clusters
  • Loading branch information
k8s-ci-robot authored Dec 21, 2021
2 parents 3af2edb + c59207a commit b5d37d2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/apis/kops/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -921,9 +921,8 @@ func validateExternalPolicies(role string, policies []string, fldPath *field.Pat
func validateEtcdClusterSpec(spec kops.EtcdClusterSpec, c *kops.Cluster, fieldPath *field.Path) field.ErrorList {
allErrs := field.ErrorList{}

if spec.Name == "" {
allErrs = append(allErrs, field.Required(fieldPath.Child("name"), "etcdCluster did not have name"))
}
allErrs = append(allErrs, IsValidValue(fieldPath.Child("name"), &spec.Name, []string{"cilium", "main", "events"})...)

if spec.Provider != "" {
value := string(spec.Provider)
allErrs = append(allErrs, IsValidValue(fieldPath.Child("provider"), &value, kops.SupportedEtcdProviderTypes)...)
Expand Down

0 comments on commit b5d37d2

Please sign in to comment.