-
Notifications
You must be signed in to change notification settings - Fork 949
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
feature: support resize the tty of cri exec process #2063
Conversation
680637a
to
3148807
Compare
Codecov Report
@@ Coverage Diff @@
## master #2063 +/- ##
==========================================
+ Coverage 58.74% 63.76% +5.01%
==========================================
Files 202 202
Lines 15535 15621 +86
==========================================
+ Hits 9126 9960 +834
+ Misses 5301 4418 -883
- Partials 1108 1243 +135
|
@fuweid @HusterWan PTAL |
cri/stream/config.go
Outdated
|
||
// SupportedStreamingProtocols is the streaming protocols which server supports. | ||
var SupportedStreamingProtocols = []string{constant.StreamProtocolV1Name, constant.StreamProtocolV2Name} | ||
var SupportedStreamingProtocols = []string{constant.StreamProtocolV1Name, constant.StreamProtocolV2Name, constant.StreamProtocolV3Name} |
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.
could we fold this line? I think it is readable if one option is in one line.
for { | ||
size := apitypes.ResizeOptions{} | ||
err := decoder.Decode(&size) | ||
if err != nil { |
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.
if the err is not EOF, I think we should show the warning message.
|
||
return ctx, true | ||
} | ||
|
||
func handleResizeEvents(stream io.Reader, channel chan<- apitypes.ResizeOptions) { |
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.
could we add the ctx or event id for log stuff?
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.
It seems we can't provide enough useful information in this function
So I do the log in function handleResizing
from which we could know the container and exec id
} | ||
go func() { | ||
for { | ||
size, ok := <-resizeChan |
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.
the size is always valid?
replyChan := make(chan struct{}) | ||
stop := make(chan struct{}) | ||
defer close(stop) | ||
WaitForStreams: |
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.
should we change the break label here? it looks like the function name...
3148807
to
b01db9d
Compare
@fuweid Updated. |
Signed-off-by: YaoZengzeng <yaozengzeng@zju.edu.cn>
b01db9d
to
6385f31
Compare
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.
LGTM
Signed-off-by: YaoZengzeng yaozengzeng@zju.edu.cn
Ⅰ. Describe what this PR did
Get resize request from resize stream
Put the resize request to channel
Spawn goroutine to process the request from channel
Call the container manager's
ResizeExec
methodCall the ctrd's
ResizeExec
methodⅡ. Does this pull request fix one issue?
Ⅲ. Describe how you did it
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews