mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-11 21:12:07 +00:00
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:
commit
5f3316fe23
@ -3990,7 +3990,7 @@ func ValidateTolerations(tolerations []core.Toleration, fldPath *field.Path) fie
|
|||||||
}
|
}
|
||||||
case core.TolerationOpExists:
|
case core.TolerationOpExists:
|
||||||
if len(toleration.Value) > 0 {
|
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:
|
default:
|
||||||
validValues := []core.TolerationOperator{core.TolerationOpEqual, core.TolerationOpExists}
|
validValues := []core.TolerationOperator{core.TolerationOpEqual, core.TolerationOpExists}
|
||||||
|
Loading…
Reference in New Issue
Block a user