-
Notifications
You must be signed in to change notification settings - Fork 105
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
[release-4.17] OCPBUGS-45964: performanceprofile cpuset input validation #1247
base: release-4.17
Are you sure you want to change the base?
Conversation
This fix ensures that the input for any CPU set field is valid. If an invalid string that does not represent a valid CPU set is provided, the admission webhook will return an appropriate error, such as: spec.cpu: Internal error: strconv.Atoi: parsing "garbage": invalid syntax This replaces the previous behavior where the server would return an error like: Error from server: error when creating "pp.yaml": admission webhook "vwb.performance.openshift.io" denied the request: panic: runtime error: invalid memory address or nil pointer dereference [recovered]. Signed-off-by: Ronny Baturov <[email protected]>
Fuzz test for ValidateCPUs to verify it handles both valid and invalid inputs without panicking. This ensures that all potential errors are exercised and no panic occurs during execution. Signed-off-by: Ronny Baturov <[email protected]>
@openshift-cherrypick-robot: Jira Issue OCPBUGS-45616 has been cloned as Jira Issue OCPBUGS-45964. Will retitle bug to link to clone. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
@openshift-cherrypick-robot: This pull request references Jira Issue OCPBUGS-45964, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
@openshift-cherrypick-robot: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
we want the backport indeed
@@ -217,6 +217,19 @@ var _ = Describe("PerformanceProfile", func() { | |||
Expect(errors).NotTo(BeEmpty(), "should have validation error when isolated and shared CPUs have overlap") | |||
Expect(errors[0].Error()).To(Or(ContainSubstring("isolated and shared cpus overlap"), ContainSubstring("shared and isolated cpus overlap"))) | |||
}) | |||
DescribeTable("should reject invalid input that does not represent CPU sets", | |||
func(fieldSetter func(*PerformanceProfile, CPUSet), cpusField string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, this is a backport, but still: are we guaranteed mutations made by each table item does not leak to other items?
e.g. are items fully isolated from each other?
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ffromani, openshift-cherrypick-robot 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 |
/lgtm |
/label backport-risk-assessed |
/jira refresh |
@yanirq: This pull request references Jira Issue OCPBUGS-45964, which is invalid:
Comment In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
This is an automated cherry-pick of #1239
/assign rbaturov
/cherrypick release-4.16