-
Notifications
You must be signed in to change notification settings - Fork 107
OCPBUGS-61662: Adding validation directly and calling existing library-go validation #576
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
OCPBUGS-61662: Adding validation directly and calling existing library-go validation #576
Conversation
|
Important Review skippedAuto reviews are limited based on label configuration. 🚫 Review skipped — only excluded labels are configured. (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
9a12467 to
bf076ca
Compare
Add ValidatePath function and integrate it with ValidateRoute and ValidateRouteUpdate to reject routes with '#' or spaces in spec.path Validation changes: - Add ValidatePath to check for # and spaces in route paths - Call the library-go validation and add additional path validation This ensures our PR matches the validation logic introduced in https://github.com/openshift/library-go/pull/2012/files Assisted with Claude Code
bf076ca to
22bc98e
Compare
| if external.Spec.Path != oldExternal.Spec.Path { | ||
| pathFieldPath := field.NewPath("spec", "path") | ||
| allErrs = append(allErrs, validatePath(external.Spec.Path, pathFieldPath)...) | ||
| } |
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, the update validation is ratcheting, so it won't block updates to preexisting routes with this problem.
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: benluddy, Thealisyed The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@Thealisyed: This pull request references Jira Issue OCPBUGS-61662, which is valid. 7 validation(s) were run on this bug
Requesting review from QA contact: The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn 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. |
|
/label cherry-pick-approved |
|
Tested it with 4.19.0-0-2025-12-18-101436-test-ci-ln-thv6cr2-latest |
|
/label qe-approved |
|
@ShudiLi: This PR has been marked as verified by DetailsIn 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. |
|
@Thealisyed: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
06c1b7b
into
openshift:release-4.19
|
@Thealisyed: Jira Issue OCPBUGS-61662: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-61662 has been moved to the MODIFIED state. DetailsIn 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. |
|
Fix included in accepted release 4.19.0-0.nightly-2025-12-19-215710 |
|
/cherry-pick release-4.18 |
|
@Thealisyed: new pull request created: #597 DetailsIn 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 kubernetes-sigs/prow repository. |
Add TestValidateRoute and TestValidateRouteUpdate tests to verify that routes with '#' or whitespace in spec.path are rejected. Tests copied from openshift#576
Add route path validation to reject # or whitespace
Add ValidatePath function and integrate it with ValidateRoute
and ValidateRouteUpdate to reject routes with '#' or spaces in spec.path
Validation changes:
This ensures our PR matches the validation logic introduced
in https://github.com/openshift/library-go/pull/2012/files