-
Notifications
You must be signed in to change notification settings - Fork 40.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify API validation error for toleration if operator
is Exists
and value
is not empty
#128119
Clarify API validation error for toleration if operator
is Exists
and value
is not empty
#128119
Conversation
Without this patch the error message for this example: ``` --- apiVersion: v1 kind: Pod metadata: name: test spec: containers: - name: agent image: debian:latest tolerations: - key: pool operator: Exists value: build effect: NoSchedule ``` Looks like: ``` The Pod "test" is invalid: spec.tolerations[0].operator: Invalid value: core.Toleration{Key:"pool", Operator:"Exists", Value:"build", Effect:"NoSchedule", TolerationSeconds:(*int64)(nil)}: value must be empty when `operator` is 'Exists' ``` To clarify that the `Value` field is wrong, we now directly point the `field.Invalid` to it. Now the error message becomes a more clear and concise one: ``` The Pod "test" is invalid: spec.tolerations[0].operator: Invalid value: "build": value must be empty when `operator` is 'Exists' ``` Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
Slight changelog tweak (suggestion) -Clarify API validation error for toleration if `operator` is `Exists` and `value` is not empty.
+Clarified an API validation error for toleration if `operator` is `Exists` and `value` is not empty. |
Thanks! Updated as suggested 👍 |
@kubernetes/api-approvers PTAL /sig api-machinery |
/approve |
LGTM label has been added. Git tree hash: 420a156883102fc5f23dd4bdf0eb8b5a8ba44433
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: liggitt, saschagrunert The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/triage accepted |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Without this patch the error message for this example:
Looks like:
To clarify that the
Value
field is wrong, we now directly point thefield.Invalid
to it. Now the error message becomes a more clear and concise one:Which issue(s) this PR fixes:
None
Special notes for your reviewer:
None
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: