-
Notifications
You must be signed in to change notification settings - Fork 237
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
Bug 2050332: explicit Pattern to validate Duration fields #1684
Bug 2050332: explicit Pattern to validate Duration fields #1684
Conversation
Due to a difference in how apiserver validates `Format=duration` vs how apimachinery unmarshals `metav1.Duration`, using that format can allow users to blow up some of our controllers if they provide certain values for Duration fields (specifically: containing `d` or `w` units). Upstream issues have been opened against both sides of this discrepancy: - kubernetes/apimachinery#131 - kubernetes/apiextensions-apiserver#56 In the meantime, work around the problem by using an explicit regex instead of the built in format validator. Closes 2050332
@2uasimojo: This pull request references Bugzilla bug 2050332, 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 kubernetes/test-infra repository. |
/bugzilla refresh |
@2uasimojo: This pull request references Bugzilla bug 2050332, 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 kubernetes/test-infra repository. |
I don't know how to make the bz "target 4.11.0". The only thing I see with "target" is "Target Milestone: ---", which I can't seem to edit. @akhil-rane can you help? |
/bugzilla refresh |
@akhil-rane: This pull request references Bugzilla bug 2050332, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
Requesting review from QA contact: 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 kubernetes/test-infra repository. |
you need to click on |
@2uasimojo: 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/test-infra repository. I understand the commands that are listed here. |
Codecov Report
@@ Coverage Diff @@
## master #1684 +/- ##
=======================================
Coverage 42.34% 42.34%
=======================================
Files 337 337
Lines 31158 31158
=======================================
Hits 13193 13193
Misses 16879 16879
Partials 1086 1086
|
Tested live, works. (Though I preferred the native error message.)
And the controllers are happy. /assign @abutcher |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 2uasimojo, abutcher 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 |
@2uasimojo: All pull requests linked via external trackers have merged: Bugzilla bug 2050332 has been moved to the MODIFIED state. 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 kubernetes/test-infra repository. |
@lwan-wanglin how does QE work for things like this with a BZ but no Jira? |
For hive BZ, we will move Status from ON_QA to Verified after testing. QE behavior won't influnce the hive PR merge because hive won't release within OCP. For CCO , we now follow non-Feature Freeze workflow, for user stories, we need QE, Docs, and PM add their respective “XXX-approved” label to the PR; for BZ, we need QE add their respective “qe-approved” label. |
/cherry-pick ocm-2.5 |
@2uasimojo: new pull request could not be created: failed to create pull request against openshift/hive#ocm-2.5 from head openshift-cherrypick-robot:cherry-pick-1684-to-ocm-2.5: status code 422 not one of [201], body: {"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"No commits between openshift:ocm-2.5 and openshift-cherrypick-robot:cherry-pick-1684-to-ocm-2.5"}],"documentation_url":"https://docs.github.com/rest/reference/pulls#create-a-pull-request"} 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 kubernetes/test-infra repository. |
/cherry-pick ocm-2.4 |
@2uasimojo: #1684 failed to apply on top of branch "ocm-2.4":
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 kubernetes/test-infra repository. |
Manual cherry-pick: #1690 |
Due to a difference in how apiserver validates
Format=duration
vs howapimachinery unmarshals
metav1.Duration
, using that format can allowusers to blow up some of our controllers if they provide certain values
for Duration fields (specifically: containing
d
orw
units).Upstream issues have been opened against both sides of this discrepancy:
d
,w
; conflicts with kubebuilderformat=duration
validation kubernetes/apimachinery#131format=duration
kubebuilder validation acceptsd
,w
; metav1.Duration does not kubernetes/apiextensions-apiserver#56In the meantime, work around the problem by using an explicit regex
instead of the built in format validator.
Closes 2050332