-
Notifications
You must be signed in to change notification settings - Fork 600
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
Use apis.HTTP() #3830
Use apis.HTTP() #3830
Conversation
Welcome @skonto! It looks like this is your first PR to knative/eventing 🎉 |
Hi @skonto. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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. |
c5d0352
to
1738cf4
Compare
/ok-to-test |
/test pull-knative-eventing-integration-tests |
The following jobs failed:
Failed non-flaky tests preventing automatic retry of pull-knative-eventing-integration-tests:
and 6 more. |
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.
I think there are some changes in the meaning of some replacements, for example here https://github.com/knative/eventing/pull/3830/files#diff-ab0df0c2544da80554e8826de8aa0d11R404
@pierDipi correct will fix. |
unit tests pass locally but the CI reports:
|
/retest |
@pierDipi fixed cases where a raw uri needs to be parsed, LMKWYT. |
/assign |
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.
Thanks @skonto!
I left some comments.
sink, _ := apis.ParseURL("uri://example") | ||
sink := apis.HTTP("example") | ||
sink.Scheme = "uri" |
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.
We set the scheme to http
and then reset it to uri
.
I think it's better to leave as it was before because the scheme isn't HTTP.
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.
Initially I thought from the description that we should use HTTP() everywhere but it is not the case. I will update it.
sink, _ := apis.ParseURL("uri://example") | ||
sink := apis.HTTP("example") | ||
sink.Scheme = "uri" |
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.
Same here.
// Set path | ||
sinkTargetURI.Path = sinkURIReference |
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.
I found complicated figuring out the full URL because it's not set in one place.
What if we use something like:
sinkTargetURI = func() apis.URL {
u := apis.HTTP(sinkDNS)
u.Path = sinkURIReference
return u
}()
or
sinkTargetURI = targetURL(sinkDNS, sinkURIReference)
// ...
func targetURL(host, path string) apis.URL {
u := apis.HTTP(host)
u.Path = path
return u
}
exampleUri, _ := apis.ParseURL("uri://example") | ||
exampleUri := apis.HTTP("example") | ||
exampleUri.Scheme = "uri" |
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.
Same here.
@pierDipi I updated the PR (also there were a couple of more places where I was setting the scheme in a different statement). |
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.
Thank you!
/lgtm
neat! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lionelvillard, pierDipi, skonto 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 |
Fixes #3623
Proposed Changes
Left untouched: