-
Notifications
You must be signed in to change notification settings - Fork 1.2k
HTTP2 and gRPC support #2539
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
Merged
knative-prow-robot
merged 18 commits into
knative:master
from
tanzeeb:http2-and-grpc-support
Jan 30, 2019
Merged
HTTP2 and gRPC support #2539
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
43d4458
Use http.DefaultTransport dialer settings in h2c.DefaultTransport
tanzeeb 0e2e7c0
Support streaming in activator/util.Rewinder
tanzeeb 3fdab18
Use custom timeout handler in queue-proxy
tanzeeb b2254d9
Use http2 instead of http as the k8s service port names
tanzeeb 79278f3
Enforce max content length for streaming requests in activator
tanzeeb bee2aa4
Don't read original reader again after rewinder is closed
tanzeeb a1ca7b1
Use chan struct{} instead of chan bool in queue-proxy timeoutHandler
tanzeeb 5239099
Move LimitReadCloser from activator handler to activator util and add…
tanzeeb 4d50862
Add/fix godoc comments for activator/util
tanzeeb 816afa8
Explictly set Dialer config defaults in h2c.DefaultTransport
tanzeeb 183ca2b
Remove timeoutHandler from queue-proxy
tanzeeb 9258466
Revert k8s Service port name from http2 to http
tanzeeb a25b30a
Run activator on two ports, to support activating both http1 and h2c …
tanzeeb e8200a5
Add RevisionProtocolType to API
tanzeeb 2987952
Dynamically select 'http' or 'http2' for k8s service port name
tanzeeb 7ce391f
Dynamically route to the http1 or h2c activator service port based on…
tanzeeb c7f6743
Add test coverage for activator.ServicePort
tanzeeb 1700fbc
Print errors in EnforceLengthHandler tests
tanzeeb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| /* | ||
| Copyright 2018 The Knative Authors | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| */ | ||
| package activator | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/knative/serving/pkg/apis/serving/v1alpha1" | ||
| ) | ||
|
|
||
| func TestServicePort(t *testing.T) { | ||
| tests := []struct { | ||
| name string | ||
| protocol v1alpha1.RevisionProtocolType | ||
| port int32 | ||
| }{{ | ||
| name: "h2c", | ||
| protocol: v1alpha1.RevisionProtocolH2C, | ||
| port: ServicePortH2C, | ||
| }, { | ||
| name: "http1", | ||
| protocol: v1alpha1.RevisionProtocolHTTP1, | ||
| port: ServicePortHTTP1, | ||
| }} | ||
|
|
||
| for _, tt := range tests { | ||
| t.Run(tt.name, func(t *testing.T) { | ||
| want := tt.port | ||
| got := ServicePort(tt.protocol) | ||
|
|
||
| if want != got { | ||
| t.Errorf("unexpected port. want %d, got %d", want, got) | ||
| } | ||
| }) | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| /* | ||
| Copyright 2018 The Knative Authors | ||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| */ | ||
|
|
||
| package util | ||
|
|
||
| import "io" | ||
|
|
||
| // LimitReadCloser returns a ReadCloser wrapped with an `io.LimitReader` | ||
| func LimitReadCloser(rc io.ReadCloser, l int64) io.ReadCloser { | ||
| return &readCloser{io.LimitReader(rc, l), rc} | ||
| } | ||
|
|
||
| type readCloser struct { | ||
| Reader io.Reader | ||
| Closer io.Closer | ||
| } | ||
|
|
||
| func (lrc *readCloser) Read(b []byte) (int, error) { | ||
| return lrc.Reader.Read(b) | ||
| } | ||
|
|
||
| func (lrc *readCloser) Close() error { | ||
| return lrc.Closer.Close() | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.