Skip to content

Commit

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

Automated cherry pick of #13011: Prevent creation of unsupported etcd clusters
  • Loading branch information
k8s-ci-robot committed Dec 21, 2021
2 parents b1ba252 + 7893d82 commit ed9ba92
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 @@ -1031,9 +1031,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, []string{string(kops.EtcdProviderTypeManager)})...)
Expand Down

0 comments on commit ed9ba92

Please sign in to comment.