-
Notifications
You must be signed in to change notification settings - Fork 950
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
refactor: modify the definition of ContainerPlugin interface #2316
refactor: modify the definition of ContainerPlugin interface #2316
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2316 +/- ##
==========================================
+ Coverage 67.2% 67.38% +0.17%
==========================================
Files 213 213
Lines 17511 17510 -1
==========================================
+ Hits 11769 11799 +30
+ Misses 4341 4319 -22
+ Partials 1401 1392 -9
|
|
||
// ContainerPlugin defines places where a plugin will be triggered in container lifecycle | ||
type ContainerPlugin interface { | ||
// PreCreate defines plugin point where receives a container create request, in this plugin point user | ||
// could change the container create body passed-in by http request body | ||
PreCreate(io.ReadCloser) (io.ReadCloser, error) | ||
PreCreate(*types.ContainerCreateConfig) 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.
Interface signature and return value are all different from origin, some files missing?
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.
@xiaoxubeii You are right...
Signed-off-by: zhuangqh <zhuangqhc@gmail.com>
cda39d5
to
aa4ef5a
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: zhuangqh zhuangqhc@gmail.com
Signed-off-by: Wei Fu fhfuwei@163.com
Ⅰ. Describe what this PR did
modify the definition of ContainerPlugin interface: PreCreate
Type
*types.ContainerCreateConfig
would be more generic, whileio.ReadCloser
read only stream data.The CRI need to support the rich-mode container so that the create_hook_plugin should be handled in container_mgr.
Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
redesign the interface
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews