Allow multi-CNI setups to set usesSecondaryIP (#10828)

* validation.go: remove checks on CNI

* move CNI block check to allow option with others CNI
This commit is contained in:
Yan Grunenberger 2021-03-01 10:26:40 +01:00 committed by GitHub
parent c802127528
commit 9d8dec60d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 7 deletions

View File

@ -541,13 +541,6 @@ func validateNetworking(cluster *kops.Cluster, v *kops.NetworkingSpec, fldPath *
optionTaken = true
}
if v.CNI != nil {
if optionTaken {
allErrs = append(allErrs, field.Forbidden(fldPath.Child("cni"), "only one networking option permitted"))
}
optionTaken = true
}
if v.Kopeio != nil {
if optionTaken {
allErrs = append(allErrs, field.Forbidden(fldPath.Child("kopeio"), "only one networking option permitted"))
@ -555,6 +548,10 @@ func validateNetworking(cluster *kops.Cluster, v *kops.NetworkingSpec, fldPath *
optionTaken = true
}
if v.CNI != nil && optionTaken {
allErrs = append(allErrs, field.Forbidden(fldPath.Child("cni"), "only one networking option permitted"))
}
if v.Weave != nil {
if optionTaken {
allErrs = append(allErrs, field.Forbidden(fldPath.Child("weave"), "only one networking option permitted"))