openshift / router

Ingress controller for OpenShift
Apache License 2.0
74 stars 116 forks source link

[release-4.13] OCPBUGS-34673: Properly handle rewrite-target annotation #608

Closed openshift-cherrypick-robot closed 5 months ago

openshift-cherrypick-robot commented 5 months ago

This is an automated cherry-pick of #583

/assign gcs278

openshift-ci-robot commented 5 months ago

@openshift-cherrypick-robot: Jira Issue OCPBUGS-32634 has been cloned as Jira Issue OCPBUGS-34673. Will retitle bug to link to clone. /retitle [release-4.13] OCPBUGS-34673: Properly handle rewrite-target annotation

In response to [this](https://github.com/openshift/router/pull/608): >This is an automated cherry-pick of #583 > >/assign gcs278 Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Frouter). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
openshift-ci-robot commented 5 months ago

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

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](https://github.com/openshift/router/pull/608): >This is an automated cherry-pick of #583 > >/assign gcs278 Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Frouter). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
gcs278 commented 5 months ago

/jira refresh

openshift-ci-robot commented 5 months ago

@gcs278: This pull request references Jira Issue OCPBUGS-34673, 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-32634](https://issues.redhat.com//browse/OCPBUGS-32634) 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-32634](https://issues.redhat.com//browse/OCPBUGS-32634) 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](https://github.com/openshift/router/pull/608#issuecomment-2139696127): >/jira refresh Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Frouter). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
openshift-ci[bot] commented 5 months ago

@openshift-cherrypick-robot: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
lihongan commented 5 months ago

/jira refresh

openshift-ci-robot commented 5 months ago

@lihongan: This pull request references Jira Issue OCPBUGS-34673, 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-32634](https://issues.redhat.com//browse/OCPBUGS-32634) 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-32634](https://issues.redhat.com//browse/OCPBUGS-32634) 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 @ShudiLi

In response to [this](https://github.com/openshift/router/pull/608#issuecomment-2141327261): >/jira refresh Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Frouter). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
ShudiLi commented 5 months ago

/label qe-approved tested it with 4.13.0-0.ci.test-2024-06-03-020738-ci-ln-605fzqk-latest

1.
% oc get clusterversion
NAME      VERSION                                                   AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.13.0-0.ci.test-2024-06-03-020738-ci-ln-605fzqk-latest   True        False         3m47s   Cluster version is 4.13.0-0.ci.test-2024-06-03-020738-ci-ln-605fzqk-latest

2.
 % oc -n openshift-ingress rsh router-default-78794fdd95-cnrst
sh-4.4$ grep "http-request replace-path" haproxy-config.template
  http-request replace-path ^{{ $cfg.Path }}/?(.*)$ '{{ processRewriteTarget $pathRewriteTarget }}'
  http-request replace-path ^{{ $cfg.Path }}(.*)$ '{{ processRewriteTarget $pathRewriteTarget }}'
sh-4.4$

3.
% oc annotate route/unsec-server3  haproxy.router.openshift.io/rewrite-target="/t t$%&*(){}[].,z#:\`_-|" --overwrite
route.route.openshift.io/unsec-server3 annotate

4.
% oc get route unsec-server3 -o=jsonpath="{.metadata.annotations.haproxy\.router\.openshift\.io/rewrite-target}"
/t t$%&*(){}[].,z#:`_-|% 
ShudiLi commented 5 months ago

/label cherry-pick-approved

alebedev87 commented 5 months ago

/lgtm /approve

openshift-ci[bot] commented 5 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alebedev87

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: - ~~[OWNERS](https://github.com/openshift/router/blob/release-4.13/OWNERS)~~ [alebedev87] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
candita commented 5 months ago

The backport introduces a change that prevents the router from crashing due to invalid rewrite-target annotations, so any risk is weighed against this benefit. Any remaining risk is eliminated because there is no change to valid rewrite-target annotations, only invalid rewrite-target annotations.

/label backport-risk-assessed

openshift-ci-robot commented 5 months ago

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

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

In response to [this](https://github.com/openshift/router/pull/608): >This is an automated cherry-pick of #583 > >/assign gcs278 Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Frouter). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
gcs278 commented 5 months ago

/cherry-pick release-4.12

openshift-bot commented 5 months ago

[ART PR BUILD NOTIFIER]

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

openshift-merge-robot commented 5 months ago

Fix included in accepted release 4.13.0-0.nightly-2024-06-10-103644

gcs278 commented 5 months ago

/cherry-pick release-4.12

openshift-cherrypick-robot commented 5 months ago

@gcs278: new pull request created: #610

In response to [this](https://github.com/openshift/router/pull/608#issuecomment-2180847392): >/cherry-pick release-4.12 Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.