Skip to content
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.13] OCPBUGS-33280: Route 'haproxy.router.openshift.io/timeout' value is not validated #591

Conversation

openshift-cherrypick-robot

This is an automated cherry-pick of #568

/assign Miciah

* OCPBUGS-6958: Fix clipHAProxyTimeoutValue so that:

* a value larger than time.ParseDuration can handle is clipped to the HAProxy max timeout
* a value that cannot be properly parsed for other reasons is set to empty instead of being silently allowed

To check that time.ParseDuration is experiencing overflow, add a new ParseHAProxyDuration to the util
package so we can evaluate the errors returned by time.ParseDuration without sacrificing its authority
in parsing time strings.

* add haproxytime

* use pkg/router/template/util/haproxytime

* drop existing ParseHAProxyDuration

* OCPBUGS-6958: Fix clipHAProxyTimeoutValue so that:

* a value larger than time.ParseDuration can handle is clipped to the HAProxy max timeout
* a value that cannot be properly parsed for other reasons is set to empty instead of being silently allowed

To check that time.ParseDuration is experiencing overflow, add a new ParseHAProxyDuration to the util
package so we can evaluate the errors returned by time.ParseDuration without sacrificing its authority
in parsing time strings.

* OCPBUGS-6958: Fix clipHAProxyTimeoutValue so that:

- a value larger than time.ParseDuration can handle is clipped to the HAProxy max timeout
- a value that cannot be properly parsed for other reasons is set to empty instead of being silently allowed

To check that time.ParseDuration is experiencing overflow, add a new ParseDuration so we
can evaluate the errors that wouldn't have been explicitly returned by time.ParseDuration,
e.g. invalid HAProxy time format syntax and integer overflows.

Add more unit tests.

* OCPBUGS-6958: Fix clipHAProxyTimeoutValue so that:

- a value larger than time.ParseDuration can handle is clipped to the HAProxy max timeout
- a value that cannot be properly parsed for other reasons is set to empty instead of being silently allowed

To check that time.ParseDuration is experiencing overflow, add a new ParseDuration so we
can evaluate the errors that wouldn't have been explicitly returned by time.ParseDuration,
e.g. invalid HAProxy time format syntax and integer overflows.

Add more unit tests.

---------

Co-authored-by: Andrew McDermott <amcdermo@redhat.com>
@openshift-ci-robot
Copy link
Contributor

@openshift-cherrypick-robot: Jira Issue OCPBUGS-30773 has been cloned as Jira Issue OCPBUGS-33280. Will retitle bug to link to clone.
/retitle [release-4.13] OCPBUGS-33280: OCPBUGS 6958 backport to 4.14

In response to this:

This is an automated cherry-pick of #568

/assign Miciah

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-ci openshift-ci bot changed the title [release-4.13] OCPBUGS-30773: OCPBUGS 6958 backport to 4.14 [release-4.13] OCPBUGS-33280: OCPBUGS 6958 backport to 4.14 May 4, 2024
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels May 4, 2024
@openshift-ci-robot
Copy link
Contributor

@openshift-cherrypick-robot: This pull request references Jira Issue OCPBUGS-33280, which is invalid:

  • release note text must be set and not match the template OR release note type must be set to "Release Note Not Required"
  • expected dependent Jira Issue OCPBUGS-30773 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but it is ON_QA instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

This is an automated cherry-pick of #568

/assign Miciah

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-ci openshift-ci bot requested review from alebedev87 and frobware May 4, 2024 15:59
Copy link
Contributor

openshift-ci bot commented May 4, 2024

@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/test-infra repository. I understand the commands that are listed here.

@candita
Copy link
Contributor

candita commented May 6, 2024

/retitle [release-4.13] OCPBUGS-33280: Route 'haproxy.router.openshift.io/timeout' value is not validated

@openshift-ci openshift-ci bot changed the title [release-4.13] OCPBUGS-33280: OCPBUGS 6958 backport to 4.14 [release-4.13] OCPBUGS-33280: Route 'haproxy.router.openshift.io/timeout' value is not validated May 6, 2024
@candita
Copy link
Contributor

candita commented May 6, 2024

/assign

@candita
Copy link
Contributor

candita commented May 6, 2024

/jira refresh

@openshift-ci-robot
Copy link
Contributor

@candita: This pull request references Jira Issue OCPBUGS-33280, which is invalid:

  • expected dependent Jira Issue OCPBUGS-30773 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but it is ON_QA instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

/jira refresh

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.

@candita candita removed their assignment May 6, 2024
@candita
Copy link
Contributor

candita commented May 7, 2024

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels May 7, 2024
@openshift-ci-robot
Copy link
Contributor

@candita: This pull request references Jira Issue OCPBUGS-33280, which is valid. The bug has been moved to the POST state.

7 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.13.z) matches configured target version for branch (4.13.z)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
  • release note text is set and does not match the template
  • dependent bug Jira Issue OCPBUGS-30773 is in the state Verified, which is one of the valid states (VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA))
  • dependent Jira Issue OCPBUGS-30773 targets the "4.14.z" version, which is one of the valid target versions: 4.14.0, 4.14.z
  • bug has dependents

Requesting review from QA contact:
/cc @lihongan

In response to this:

/jira refresh

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-ci openshift-ci bot requested a review from lihongan May 7, 2024 20:07
@lihongan
Copy link
Contributor

lihongan commented May 8, 2024

/label qe-approved

verified with per-merge testing

$ oc get clusterversion
NAME      VERSION                                                   AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.13.0-0.ci.test-2024-05-08-031117-ci-ln-fnjbk42-latest   True        False         9m46s   Cluster version is 4.13.0-0.ci.test-2024-05-08-031117-ci-ln-fnjbk42-latest

### create pod,svc,route and annotate `haproxy.router.openshift.io/timeout` with various value

### review the router log
$ oc -n openshift-ingress get pod
NAME                              READY   STATUS    RESTARTS   AGE
router-default-5f98f85d8b-6dhd4   1/1     Running   0          39m
router-default-5f98f85d8b-84vmc   1/1     Running   0          39m

I0508 03:55:53.066984       1 template_helper.go:340] template "msg"="route annotation timeout exceeds maximum allowable format, clipping to 2147483647ms" "input"="100000000000s"

I0508 04:01:06.516190       1 template_helper.go:353] template "msg"="route annotation timeout exceeds maximum allowable by HAProxy, clipping to 2147483647ms" "input"="106751d"

I0508 04:02:23.020550       1 template_helper.go:340] template "msg"="route annotation timeout exceeds maximum allowable format, clipping to 2147483647ms" "input"="106752d"

I0508 04:03:09.793814       1 template_helper.go:340] template "msg"="route annotation timeout exceeds maximum allowable format, clipping to 2147483647ms" "input"="9223372036854776us"

I0508 04:04:26.411049       1 template_helper.go:340] template "msg"="route annotation timeout exceeds maximum allowable format, clipping to 2147483647ms" "input"="18446744073709551615us"

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label May 8, 2024
@openshift-ci-robot
Copy link
Contributor

@openshift-cherrypick-robot: This pull request references Jira Issue OCPBUGS-33280, which is valid.

7 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.13.z) matches configured target version for branch (4.13.z)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
  • release note text is set and does not match the template
  • dependent bug Jira Issue OCPBUGS-30773 is in the state Verified, which is one of the valid states (VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA))
  • dependent Jira Issue OCPBUGS-30773 targets the "4.14.z" version, which is one of the valid target versions: 4.14.0, 4.14.z
  • bug has dependents

Requesting review from QA contact:
/cc @lihongan

In response to this:

This is an automated cherry-pick of #568

/assign Miciah

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.

@lihongan
Copy link
Contributor

lihongan commented May 8, 2024

/label cherry-pick-approved

@openshift-ci openshift-ci bot added the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label May 8, 2024
@frobware
Copy link
Contributor

frobware commented May 8, 2024

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 8, 2024
Copy link
Contributor

openshift-ci bot commented May 8, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: frobware

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 8, 2024
@candita
Copy link
Contributor

candita commented May 8, 2024

@Miciah's assessment of backport risk from the backport to 4.14 in #568:

The change is scoped to the clipHAProxyTimeoutValue template helper function. This function is somewhat performance-sensitive and security-critical. However, it already has good unit test coverage for valid and invalid values, and this change increases test coverage with additional syntactically invalid and out-of-range test values; and the code complexity is not increased by this change (and pre-compiling time.ParseDuration(haproxyMaxTimeout) should improve performance). I believe the risk is acceptable.

/label backport-risk-assessed

@openshift-ci openshift-ci bot added the backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. label May 8, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit d8cccd4 into openshift:release-4.13 May 8, 2024
8 checks passed
@openshift-ci-robot
Copy link
Contributor

@openshift-cherrypick-robot: Jira Issue OCPBUGS-33280: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-33280 has been moved to the MODIFIED state.

In response to this:

This is an automated cherry-pick of #568

/assign Miciah

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-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

This PR has been included in build ose-haproxy-router-base-container-v4.13.0-202405081640.p0.gd8cccd4.assembly.stream.el8 for distgit ose-haproxy-router-base.
All builds following this will include this PR.

@candita
Copy link
Contributor

candita commented May 9, 2024

/cherry-pick release-4.12

@openshift-cherrypick-robot
Copy link
Author

@candita: new pull request created: #593

In response to this:

/cherry-pick release-4.12

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.

@openshift-merge-robot
Copy link
Contributor

Fix included in accepted release 4.13.0-0.nightly-2024-05-09-130302

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants