-
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: implement StopContainer, RemoveContainer and ListContainers of cri manager #527
feature: implement StopContainer, RemoveContainer and ListContainers of cri manager #527
Conversation
@allencloud PTAL. |
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 please add unit test for function extractLabels
, parseUint32
, parseContainerName
and filterCRIContainers
?
daemon/mgr/cri.go
Outdated
func parseContainerName(name string) (*runtime.ContainerMetadata, error) { | ||
parts := strings.Split(name, nameDelimiter) | ||
if len(parts) != 6 { | ||
return nil, fmt.Errorf("failed to parse container name: %q", name) |
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 think here we only throw the error, but have not told users the root cause of the error.
How about fmt.Errorf("failed to parse container name %q: name format must be in format blablabla", name)
CI fails @YaoZengzeng |
09699d9
to
f8b06b7
Compare
…of cri manager Signed-off-by: YaoZengzeng <[email protected]>
f8b06b7
to
fa110bf
Compare
@allencloud updated. Maybe we should move tool functions like I'll do it in another PR, is this OK? |
Totally agree. I think it looks not so clear in dir mgr currently. |
Codecov Report
@@ Coverage Diff @@
## master #527 +/- ##
==========================================
- Coverage 17.38% 16.41% -0.97%
==========================================
Files 36 36
Lines 1829 1937 +108
==========================================
Hits 318 318
- Misses 1476 1584 +108
Partials 35 35
Continue to review full report at Codecov.
|
LGTM, please add a PR for unit test ASAP. Thanks. |
Signed-off-by: YaoZengzeng [email protected]
1.Describe what this PR did
2.Does this pull request fix one issue?
fixes part of #420
3.Describe how you did it
4.Describe how to verify it
Maybe the cri-tools is what you need.
We may use the following method to verify that we can stop, remove and list container in sandbox:
5.Special notes for reviews