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

validator: ensure no network backend path #2719

Merged
merged 7 commits into from
Nov 15, 2023

Conversation

MustafaSaber
Copy link
Member

Make sure that network backends doesn't include paths.

@MustafaSaber MustafaSaber changed the base branch from master to cw2023freeze November 6, 2023 18:21
Signed-off-by: Mustafa Abdelrahman <[email protected]>
@@ -1 +1 @@
single filter expected
single filter expected at \\\"foo\(42\) -> bar\(24\)\\\"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to the change but makes this test case more robust.

@@ -1 +1 @@
single predicate expected
single predicate expected at \\\"Foo\(\\\\\\"X-Bar\\\\\\", \\\\\\"42\\\\\\"\) && Bar\(\\\\\\"X-Foo\\\\\\", \\\\\\"24\\\\\\"\)\\\"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to the change but makes this test case more robust.

@MustafaSaber MustafaSaber marked this pull request as ready for review November 7, 2023 15:55
@szuecs
Copy link
Member

szuecs commented Nov 7, 2023

👍

Signed-off-by: Mustafa Abdelrahman <[email protected]>
Signed-off-by: Mustafa Abdelrahman <[email protected]>
Signed-off-by: Mustafa Abdelrahman <[email protected]>
Signed-off-by: Mustafa Abdelrahman <[email protected]>
@szuecs
Copy link
Member

szuecs commented Nov 14, 2023

👍

Comment on lines 136 to 140
{
name: "routegroup with invalid backends",
inputFile: "rg-with-invalid-backend-path.json",
message: `backend address \"http://example.com/foo\" contains path or query\nbackend address \"http://example.com/foo/bar\" contains path or query\nbackend address \"http://example.com/foo/\" contains path or query\nbackend address \"/foo\" contains path or query\nbackend address \"http://example.com/\" contains path or query\nbackend address \"example.com/\" contains path or query\nbackend address \"example.com/foo\" contains path or query\nbackend address \"http://example.com?foo=bar\" contains path or query`,
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need an essentially copy-pasted test case for the webhook given that it relies on the dataclients Validator that has its own test?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If both validators have the same options then no, but maybe webhook has more strict way of validation later. Also this tests webhook response, so the error maybe the same but the response is different.

@RomanZavodskikh
Copy link
Member

👍

…sure we only validate network backends.

Signed-off-by: Mustafa Abdelrahman <[email protected]>
@AlexanderYastrebov
Copy link
Member

👍

@szuecs
Copy link
Member

szuecs commented Nov 15, 2023

👍

@MustafaSaber MustafaSaber merged commit 3e18858 into cw2023freeze Nov 15, 2023
9 checks passed
@MustafaSaber MustafaSaber deleted the validate-backend-path branch November 15, 2023 16:50
@MustafaSaber MustafaSaber changed the title Validate backend path Validator: ensure no network backend path Nov 16, 2023
@MustafaSaber MustafaSaber changed the title Validator: ensure no network backend path validator: ensure no network backend path Nov 16, 2023
AlexanderYastrebov pushed a commit that referenced this pull request Nov 27, 2023
Validate that network backends doesn't have paths

Include query params into validation

Include missing scheme, rename functions for consistant naming and ensure we only validate network backends.

Signed-off-by: Mustafa Abdelrahman <[email protected]>
AlexanderYastrebov pushed a commit that referenced this pull request Nov 27, 2023
Validate that network backends doesn't have paths

Include query params into validation

Include missing scheme, rename functions for consistant naming and ensure we only validate network backends.

Signed-off-by: Mustafa Abdelrahman <[email protected]>
AlexanderYastrebov added a commit that referenced this pull request Dec 6, 2023
…at in the error message

Followup on #2719

Signed-off-by: Alexander Yastrebov <[email protected]>
AlexanderYastrebov added a commit that referenced this pull request Dec 6, 2023
…at in the error message

Followup on #2719

Signed-off-by: Alexander Yastrebov <[email protected]>
AlexanderYastrebov added a commit that referenced this pull request Dec 6, 2023
…at in the error message (#2778)

Followup on #2719

Signed-off-by: Alexander Yastrebov <[email protected]>
AlexanderYastrebov added a commit that referenced this pull request Dec 6, 2023
Disable address validation to prevent errors for existing RouteGroups.

Reverts #2719

Signed-off-by: Alexander Yastrebov <[email protected]>
AlexanderYastrebov added a commit that referenced this pull request Dec 6, 2023
Disable address validation to prevent errors for existing RouteGroups.

Reverts #2719

Signed-off-by: Alexander Yastrebov <[email protected]>
AlexanderYastrebov added a commit that referenced this pull request Dec 6, 2023
Disable address validation to prevent errors for existing RouteGroups.

Reverts #2719

Signed-off-by: Alexander Yastrebov <[email protected]>
AlexanderYastrebov added a commit that referenced this pull request Dec 6, 2023
…2780)

Disable address validation to prevent errors for existing RouteGroups.

Reverts #2719

Signed-off-by: Alexander Yastrebov <[email protected]>
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

Successfully merging this pull request may close these issues.

4 participants