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

Add regex rewrite #1854

Closed
wants to merge 21 commits into from
Closed

Conversation

SpecialYang
Copy link
Member

@SpecialYang SpecialYang commented Jan 27, 2021

In our gateway case, we definitely need this awesome feature to meet so many path routes. Maybe EnvoyFilter can support regex rewrite for data plane. But we are tired to name these routes that require regular rewriting. Only if we pick meaningful names for these routes, EnvoyFilter can match these route names and apply regex rewrite policy. Adding regex rewrite api for rewrite in HTTPRoute is the easy way to fix this case. I think someone needs this feature like me.

Based on this pr #1566, introduce RegexMatchAndSubstitute which may be used in the future for similar cases.
@howardjohn @hzxuzhonghu

Fixes istio/istio#22290 and istio/istio#24172.

@istio-policy-bot
Copy link

😊 Welcome @SpecialYang! This is either your first contribution to the Istio api repo, or it's been
awhile since you've been here.

You can learn more about the Istio working groups, code of conduct, and contributing guidelines
by referring to Contributing to Istio.

Thanks for contributing!

Courtesy of your friendly welcome wagon.

@google-cla
Copy link

google-cla bot commented Jan 27, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no Set by the Google CLA bot to indicate the author of a PR has not signed the Google CLA. label Jan 27, 2021
@istio-testing istio-testing added needs-rebase Indicates a PR needs to be rebased before being merged size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 27, 2021
@istio-testing
Copy link
Collaborator

Hi @SpecialYang. Thanks for your PR.

I'm waiting for a istio member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@google-cla
Copy link

google-cla bot commented Jan 27, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@istio-testing istio-testing added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed needs-rebase Indicates a PR needs to be rebased before being merged size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 27, 2021
@SpecialYang
Copy link
Member Author

@googlebot I consent

@google-cla
Copy link

google-cla bot commented Jan 27, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@howardjohn
Copy link
Member

I am personally fine with this, but wanted to echo @costinm concern: #1566 (comment)

At least we should bounce the idea with the K8S Services WG - and the other projects planning to support the K8S APIs.
I assume since this didn't make it to 1.9 we can afford few weeks to discuss with the relevant WGs.

@hzxuzhonghu
Copy link
Member

lgtm

At least we should bounce the idea with the K8S Services WG

Is this the service-apis?

@SpecialYang
Copy link
Member Author

I am personally fine with this, but wanted to echo @costinm concern: #1566 (comment)

At least we should bounce the idea with the K8S Services WG - and the other projects planning to support the K8S APIs.
I assume since this didn't make it to 1.9 we can afford few weeks to discuss with the relevant WGs.

Same question. Why is it related to service APIs?

The regex rewrite policy for uri is basic feature in most gateway products. Our gateway envoy get runtime configs from istiod via xds protocol. We must apply many EnvoyFilter configs and pick up meaningful names for target routes. We want an easy way just like configuring the regex rewrite policy directly in HTTPRoute, which is clear.

As I know, current istiod use RE2 for all regex match cases. I think we can also use it in regex rewrite until istiod support different regex styles.

I'm sure many users will look forward to this feature. Thanks.

@gengleilei
Copy link

Great. adding regular-based rewriting is necessary.

@istio-testing istio-testing added the needs-rebase Indicates a PR needs to be rebased before being merged label Jan 30, 2021
@google-cla
Copy link

google-cla bot commented Feb 1, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@istio-testing istio-testing removed the needs-rebase Indicates a PR needs to be rebased before being merged label Feb 1, 2021
@SpecialYang
Copy link
Member Author

I am personally fine with this, but wanted to echo @costinm concern: #1566 (comment)

At least we should bounce the idea with the K8S Services WG - and the other projects planning to support the K8S APIs.
I assume since this didn't make it to 1.9 we can afford few weeks to discuss with the relevant WGs.

Same question. Why is it related to service APIs?

The regex rewrite policy for uri is basic feature in most gateway products. Our gateway envoy get runtime configs from istiod via xds protocol. We must apply many EnvoyFilter configs and pick up meaningful names for target routes. We want an easy way just like configuring the regex rewrite policy directly in HTTPRoute, which is clear.

As I know, current istiod use RE2 for all regex match cases. I think we can also use it in regex rewrite until istiod support different regex styles.

I'm sure many users will look forward to this feature. Thanks.

@howardjohn @costinm PTAL. Thanks.

@google-cla google-cla bot added cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. and removed cla: no Set by the Google CLA bot to indicate the author of a PR has not signed the Google CLA. labels Feb 7, 2023
@istio-testing istio-testing added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 7, 2023
@google-cla google-cla bot added the cla: no Set by the Google CLA bot to indicate the author of a PR has not signed the Google CLA. label Feb 7, 2023
@istio-policy-bot
Copy link

🤔 🐛 You appear to be fixing a bug in Go code, yet your PR doesn't include updates to any test files. Did you forget to add a test?

Courtesy of your friendly test nag.

@google-cla google-cla bot removed the cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. label Feb 7, 2023
@istio-testing istio-testing added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 7, 2023
@google-cla google-cla bot added cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. and removed cla: no Set by the Google CLA bot to indicate the author of a PR has not signed the Google CLA. labels Feb 7, 2023
@gabomarf
Copy link

Can you review this PR, please ?

@dcberg
@duderino
@linsun
@louiscryan
@nrjpoddar
@smawson
@istio/technical-oversight-committee

@istio-testing istio-testing added the needs-rebase Indicates a PR needs to be rebased before being merged label Mar 13, 2023
@istio-testing
Copy link
Collaborator

PR needs rebase.

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.

@timonwong
Copy link
Contributor

Seems this is completed in #2753

@SpecialYang
Copy link
Member Author

Fixed by #2753.

@SpecialYang SpecialYang closed this Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. needs-ok-to-test needs-rebase Indicates a PR needs to be rebased before being merged size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regex rewrites using capture groups