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

Rewrite test issue #62

Open
ianrenUipath opened this issue Oct 26, 2021 · 0 comments
Open

Rewrite test issue #62

ianrenUipath opened this issue Oct 26, 2021 · 0 comments

Comments

@ianrenUipath
Copy link

ianrenUipath commented Oct 26, 2021

Hi,
For a VS rewrite rule, VS would rewrite the path (or the prefix) portion of the URI with the uri value provided.

If the original URI was matched based on prefix, the value provided in this field will replace the corresponding matched prefix. (https://istio.io/latest/docs/reference/config/networking/virtual-service/#HTTPRewrite)

But, in the validator, it does not support compare the test request uri after rewriting with the uri we provided in the test case.

For example, we have a VS rule:

name: example_rule
match:
  uri:
    prefix: /examplePrefix
rewrite:
  uri: /
route:
  destination:
    host: example_destination_host
    port:
      number: 80

and a test:

description:  example_rule_test
wantMatch: true
request:
  authority: ["example"]
  method: ["GET"]
  uri: ["/examplePrefix", "/examplePrefix/somePrefix"]
route:
  destination:
    host: example_destination_host
    port:
      number: 80
rewrite:
  uri: /

it should work as the test case has same rewrite section as "example_rule".

Is there any way we can compare the test request uri after rewriting with the uri we provided in the test case?

like:

description:  example_rule_test
wantMatch: true
request:
  authority: ["example"]
  method: ["GET"]
  uri: ["/examplePrefix/somePrefix"]
route:
  destination:
    host: example_destination_host
    port:
      number: 80
uriAfterRewrite:
  uri: /somePrefix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant