Merge pull request #128119 from saschagrunert/api-validation-err

Clarify API validation error for toleration if `operator` is `Exists` and `value` is not empty
This commit is contained in:
Kubernetes Prow Robot 2024-10-21 19:44:59 +01:00 committed by GitHub
commit 5f3316fe23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3990,7 +3990,7 @@ func ValidateTolerations(tolerations []core.Toleration, fldPath *field.Path) fie
}
case core.TolerationOpExists:
if len(toleration.Value) > 0 {
allErrors = append(allErrors, field.Invalid(idxPath.Child("operator"), toleration, "value must be empty when `operator` is 'Exists'"))
allErrors = append(allErrors, field.Invalid(idxPath.Child("operator"), toleration.Value, "value must be empty when `operator` is 'Exists'"))
}
default:
validValues := []core.TolerationOperator{core.TolerationOpEqual, core.TolerationOpExists}