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

Solves #1966. Disable HTTP/2 when a SPDY request is detected in the okteto deploy proxy #1967

Merged
merged 3 commits into from Nov 16, 2021

Conversation

ifbyol
Copy link
Member

@ifbyol ifbyol commented Nov 12, 2021

Signed-off-by: Nacho Fuertes nacho@okteto.com

Fixes #1966

Proposed changes

  • When a SPDY request is detected in the proxy, I create a reverse proxy with HTTP/2 disabled and forward the request using that proxy. By default, the TLS config for *rest.Config uses HTTP/2 first which is incompatible with SPDY

…kteto deploy proxy

Signed-off-by: Nacho Fuertes <nacho@okteto.com>
@ifbyol ifbyol requested a review from a team November 12, 2021 17:39
@codecov
Copy link

codecov bot commented Nov 12, 2021

Codecov Report

Merging #1967 (0b4a5b5) into master (f5de696) will decrease coverage by 0.05%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1967      +/-   ##
==========================================
- Coverage   33.31%   33.26%   -0.06%     
==========================================
  Files         125      125              
  Lines       13935    13956      +21     
==========================================
  Hits         4642     4642              
- Misses       8791     8812      +21     
  Partials      502      502              
Impacted Files Coverage Δ
cmd/deploy/deploy.go 16.95% <0.00%> (-2.38%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f5de696...0b4a5b5. Read the comment docs.

…troy operation

Signed-off-by: Nacho Fuertes <nacho@okteto.com>
Comment on lines +109 to +112
if gvk.Kind == jobKind {
deletePropagation := metav1.DeletePropagationBackground
deleteOpts.PropagationPolicy = &deletePropagation
}
Copy link
Member Author

Choose a reason for hiding this comment

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

@pchico83 with the example provided by Tere in the issue, the pod generated by a Job is not being deleted. As it is created by the job controller, it does not have the deployed-by label, and it seems that by default, client-go don't include the propagation policy (while kubectl does). So I'm including it in case of jobs (I see we already have this propagation policy on our code). For now I just added it for Jobs, should I include it for other Kinds?

Copy link
Contributor

Choose a reason for hiding this comment

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

@ifbyol nothing else comes to my mind

Comment on lines +109 to +112
if gvk.Kind == jobKind {
deletePropagation := metav1.DeletePropagationBackground
deleteOpts.PropagationPolicy = &deletePropagation
}
Copy link
Contributor

Choose a reason for hiding this comment

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

@ifbyol nothing else comes to my mind

@derek derek bot added the no-dco label Nov 16, 2021
@derek
Copy link

derek bot commented Nov 16, 2021

Thank you for your contribution. unfortunately, one or more of your commits are missing the required "Signed-off-by:" statement. Signing off is part of the Developer Certificate of Origin (DCO) which is used by this project.

Read the DCO and project contributing guide carefully, and amend your commits using the git CLI. Note that this does not require any cryptography, keys or special steps to be taken.

💡 Shall we fix this?

This will only take a few moments.

First, clone your fork and checkout this branch using the git CLI.

Next, set up your real name and email address:

git config --global user.name "Your Full Name"
git config --global user.email "you@domain.com"

Finally, run one of these commands to add the "Signed-off-by" line to your commits.

If you only have one commit so far then run: git commit --amend --signoff and then git push --force.
If you have multiple commits, watch this video.

Check that the message has been added properly by running "git log".

@ifbyol ifbyol merged commit 17dfe08 into master Nov 16, 2021
@ifbyol ifbyol deleted the ifbyol/fix-okteto-deploy-with-spdy-requests branch November 16, 2021 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Portforward request with empty body
3 participants