-
Notifications
You must be signed in to change notification settings - Fork 116
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
Bug 1896474: HTTPS redirect happens even if there is a more specific http-only route #343
Bug 1896474: HTTPS redirect happens even if there is a more specific http-only route #343
Conversation
b2be003
to
5292e24
Compare
/bugzilla refresh |
@miheer: No Bugzilla bug is referenced in the title of this pull request. In response to this:
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. |
/bugzilla refresh |
@miheer: This pull request references Bugzilla bug 1896474, which is invalid:
Comment In response to this:
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. |
@miheer: This pull request references Bugzilla bug 1896474, which is invalid:
Comment In response to this:
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. |
/bugzilla refresh |
@miheer: This pull request references Bugzilla bug 1896474, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
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. |
422fbc2
to
c6c965d
Compare
I am still working on to fix the unit test as the following is failing -> === RUN TestGenerateHAProxyMap |
c6c965d
to
e2b1441
Compare
/retest |
"test:api-route", | ||
"dev:reencrypt-route", | ||
"prod:backend-route", | ||
"stg:api-route", | ||
"prod:api-route", | ||
"1", | ||
"0", | ||
"1", | ||
"0", | ||
"0", | ||
"1", | ||
"1", | ||
"0", | ||
"1", | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why include the key and not the value as we discussed?
if cfg.InsecurePolicy == routev1.InsecureEdgeTerminationPolicyRedirect { | ||
return &HAProxyMapEntry{ | ||
Key: templateutil.GenerateRouteRegexp(cfg.Host, cfg.Path, cfg.IsWildcard), | ||
Value: "1", | ||
} | ||
} else { | ||
return &HAProxyMapEntry{ | ||
Key: templateutil.GenerateRouteRegexp(cfg.Host, cfg.Path, cfg.IsWildcard), | ||
Value: "0"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the formatting issue with the }
at the end of the line, consider using switch
, and reduce code duplication.
e2b1441
to
4b91bf4
Compare
/bugzilla cc-qa |
@melvinjoseph86: This pull request references Bugzilla bug 1896474, which is valid. 3 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Bugzilla (mjoseph@redhat.com), skipping review request. In response to this:
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. |
/lgtm Verified via pre-merge verification workflow, more references related to the test can be found in: |
4b91bf4
to
3fcaab2
Compare
Key: templateutil.GenerateRouteRegexp(cfg.Host, cfg.Path, cfg.IsWildcard), | ||
} | ||
switch cfg.InsecurePolicy { | ||
case routev1.InsecureEdgeTerminationPolicyRedirect: | ||
haproxyMapEntry.Value = "1" | ||
return haproxyMapEntry | ||
default: | ||
haproxyMapEntry.Value = "0" | ||
return haproxyMapEntry | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be simplified:
Key: templateutil.GenerateRouteRegexp(cfg.Host, cfg.Path, cfg.IsWildcard), | |
} | |
switch cfg.InsecurePolicy { | |
case routev1.InsecureEdgeTerminationPolicyRedirect: | |
haproxyMapEntry.Value = "1" | |
return haproxyMapEntry | |
default: | |
haproxyMapEntry.Value = "0" | |
return haproxyMapEntry | |
} | |
Key: templateutil.GenerateRouteRegexp(cfg.Host, cfg.Path, cfg.IsWildcard), | |
Value: "0", | |
} | |
switch cfg.InsecurePolicy { | |
case routev1.InsecureEdgeTerminationPolicyRedirect: | |
haproxyMapEntry.Value = "1" | |
} | |
return haproxyMapEntry |
… http-only route Let's say we have 2 routes like this: - HTTP-only route for "myapp.apps.example.com" domain and "/mypath" path - HTTPS-edge-redirect route for "myapp.apps.example.com" and no path In such situation, redirect is sent for any query to "myapp.apps.example.com", including "myapp.apps.example.com/mypath", so the more specific path route is not taking precedence as expected.
3fcaab2
to
019c5ac
Compare
/retest |
/retest-required |
1 similar comment
/retest-required |
/lgtm Verified via pre-merge verification workflow, more references related to the test can be found in: |
@Miciah PTAL. Can you please approve ? |
Thanks! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: melvinjoseph86, Miciah, miheer 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 |
@miheer: All pull requests linked via external trackers have merged: Bugzilla bug 1896474 has been moved to the MODIFIED state. In response to this:
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. |
/bugzilla refresh |
@melvinjoseph86: Bugzilla bug 1896474 is in an unrecognized state (ON_QA) and will not be moved to the MODIFIED state. In response to this:
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. |
/cherry-pick release-4.9 |
@miheer: new pull request created: #367 In response to this:
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. |
Bug 2002205 - HTTPS redirect happens even if there is a more specific http-only route
Let's say we have 2 routes like this:
In such situation, redirect is sent for any query to "myapp.apps.example.com", including "myapp.apps.example.com/mypath", so the more specific path route is not taking precedence as expected.