-
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: basic framework of stream server for cri manager #797
feature: basic framework of stream server for cri manager #797
Conversation
Signed-off-by: YaoZengzeng <[email protected]>
1de72d6
to
ed65fe6
Compare
Signed-off-by: YaoZengzeng <[email protected]>
ed65fe6
to
c2d0949
Compare
Codecov Report
@@ Coverage Diff @@
## master #797 +/- ##
==========================================
- Coverage 13.7% 13.66% -0.04%
==========================================
Files 108 109 +1
Lines 6492 6511 +19
==========================================
Hits 890 890
- Misses 5543 5562 +19
Partials 59 59
Continue to review full report at Codecov.
|
@allencloud PTAL. |
aa8d440
to
5804280
Compare
Signed-off-by: YaoZengzeng <[email protected]>
5804280
to
3a578c0
Compare
} | ||
|
||
// WriteError translates a CRI streaming error into an appropriate HTTP response. | ||
func WriteError(err error, w http.ResponseWriter) error { |
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 have no idea that how many grpc code grpc server would return. However, if there are lots of its, maybe we can refer to https://github.com/moby/moby/blob/master/api/server/httputils/errors.go#L98-L129
w.Header().Add(httpstream.HeaderUpgrade, HeaderSpdy31) | ||
w.WriteHeader(http.StatusSwitchingProtocols) | ||
|
||
// 获取底层的连接 |
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 you make this in English? 😄
if err != nil { | ||
return "", err | ||
} | ||
// 将cache entry加入list |
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.
? 😄
|
||
// Insert the given request into the cache and returns the token used for fetching it out. | ||
func (c *requestCache) Insert(req request) (token string, err error) { | ||
c.lock.Lock() |
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 am wondering if this lock is locking two much actions, not only data. Just add a comment, since no testing data no bb. Not blocking.
LGTM |
Signed-off-by: YaoZengzeng [email protected]
Ⅰ. Describe what this PR did
This PR will implement the stream server and Exec method of CRI manager.
The other two stream server related method Attach and PortForward will be implemented in other PRs
Ⅱ. Does this pull request fix one issue?
fixes part of #420
Ⅲ. Describe how you did it
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews