Skip to content

Commit

Permalink
Merge pull request #128119 from saschagrunert/api-validation-err
Browse files Browse the repository at this point in the history
Clarify API validation error for toleration if `operator` is `Exists` and `value` is not empty
  • Loading branch information
k8s-ci-robot authored Oct 21, 2024
2 parents 8d37306 + 544d8c0 commit 5f3316f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/apis/core/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 5f3316f

Please sign in to comment.