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

OCPBUGS-9037: Require http 1.1 or earlier when using curl #28301

Merged
merged 1 commit into from Oct 19, 2023

Conversation

rfredette
Copy link
Contributor

ReadResponse from golang's net/http package cannot parse http/2 response text as generated by curl. To work around this, force http/1.1 or earlier to be used.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 5, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 5, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@rfredette
Copy link
Contributor Author

/test e2e-gcp-ovn

Copy link
Contributor

@Miciah Miciah left a comment

Choose a reason for hiding this comment

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

It's surprising and unfortunate that ReadResponse cannot handle HTTP/2. I guess there isn't a handy drop-in replacement for ReadResponse?

test/extended/util/url/url.go Show resolved Hide resolved
@rfredette
Copy link
Contributor Author

To add more detail, there's a conversation about this in the issue golang/go#48766. I think the key takeaway is this comment from the issue:

The output of curl given above is not HTTP/2; it's curl's translation of an HTTP/2 stream into a human-readable form that mimics the familiar HTTP/1.x protocol.

When debugging this issue, I saw a number of suggestions from StackOverflow and elsewhere that suggested just replacing HTTP/2 in curl's output with HTTP/2.0 would be enough to get ReadResponse to parse the output. With that in mind, I see 3 options here:

  1. Before attempting to parse curl's output, check if it is HTTP/2, and replace the version number with HTTP/2.0.
  2. Remove curl from the equation, and do the connection using net/http's client type & related functions.
  3. Require curl to use HTTP/1.1 or earlier, and continue using ReadResponse to parse the output.

Option (1) requires editing the output of curl, and technically is not even correct in light of the golang issue I mentioned above, so I'm disinclined to go with it. (2) is probably the most long-term effective solution, but I'm unsure how big of a change it'd be. (3) was the easiest to implement, since it just requires an additional flag passed to curl. It also shouldn't change the behavior of this function anywhere other than in the canary case, since if they were using HTTP/2 or newer connections, we'd already be seeing tests that use ToShell failing in places other than my PR, openshift/cluster-ingress-operator#978.
I think that there's an argument that if you wanted to test that the ingress canary is working as it's expected to be used by the ingress operator, it would be better to use whatever HTTP version the operator's using, but my understanding is that the test that's failing in my PR, [sig-arch] Managed cluster [It] should expose cluster services outside the cluster [apigroup:route.openshift.io] [Skipped:Disconnected] [Suite:openshift/conformance/parallel] is only using the canary route to make sure that routes in general are properly exposed, so in this case, I don't think that's a concern.

ReadResponse from golang's net/http package cannot parse http/2 response
text as generated by curl. To work around this, force http/1.1 or
earlier to be used.
@rfredette rfredette changed the title WIP: Require http 1.1 or earlier when using curl OCPBUGS-9037: Require http 1.1 or earlier when using curl Oct 6, 2023
@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Oct 6, 2023
@openshift-ci-robot
Copy link

@rfredette: This pull request references Jira Issue OCPBUGS-9037, which is invalid:

  • expected the bug to target the "4.15.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

ReadResponse from golang's net/http package cannot parse http/2 response text as generated by curl. To work around this, force http/1.1 or earlier to be used.

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.

@rfredette rfredette marked this pull request as ready for review October 6, 2023 20:02
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 6, 2023
@openshift-ci openshift-ci bot requested review from bparees and deads2k October 6, 2023 20:03
@rfredette
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Oct 6, 2023
@openshift-ci-robot
Copy link

@rfredette: This pull request references Jira Issue OCPBUGS-9037, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.15.0) matches configured target version for branch (4.15.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @lihongan

In response to this:

/jira refresh

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.

@openshift-ci-robot openshift-ci-robot removed the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Oct 6, 2023
@openshift-ci openshift-ci bot requested a review from lihongan October 6, 2023 20:06
@rfredette
Copy link
Contributor Author

/retest

@rfredette
Copy link
Contributor Author

test failures look unrelated.
/retest

@rfredette
Copy link
Contributor Author

test failures are unrelated.
/retest

@Miciah
Copy link
Contributor

Miciah commented Oct 11, 2023

Thanks!
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 11, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 11, 2023

@rfredette: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-ovn-single-node-upgrade f90ba61 link false /test e2e-aws-ovn-single-node-upgrade
ci/prow/e2e-aws-ovn-single-node-serial f90ba61 link false /test e2e-aws-ovn-single-node-serial

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@rfredette
Copy link
Contributor Author

/assign bparees

@knobunc
Copy link
Contributor

knobunc commented Oct 18, 2023

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 18, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: knobunc, Miciah, rfredette

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 18, 2023
@openshift-ci openshift-ci bot merged commit e1c6197 into openshift:master Oct 19, 2023
21 of 23 checks passed
@openshift-ci-robot
Copy link

@rfredette: Jira Issue OCPBUGS-9037: Some pull requests linked via external trackers have merged:

The following pull requests linked via external trackers have not merged:

These pull request must merge or be unlinked from the Jira bug in order for it to move to the next state. Once unlinked, request a bug refresh with /jira refresh.

Jira Issue OCPBUGS-9037 has not been moved to the MODIFIED state.

In response to this:

ReadResponse from golang's net/http package cannot parse http/2 response text as generated by curl. To work around this, force http/1.1 or earlier to be used.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants