Skip to content
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 PullImage and ListImages methods for cri manager #477

Merged

Conversation

YaoZengzeng
Copy link
Contributor

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 pull and list images:

[root@pouch-test pouch]# crictl pull docker.io/library/redis:alpine
[root@pouch-test pouch]# crictl images
IMAGE                       TAG                 IMAGE ID            SIZE
docker.io/library/redis     alpine              0153c5db97e58       10.1MB

5.Special notes for reviews

@YaoZengzeng
Copy link
Contributor Author

@skoo87 @allencloud PTAL.

@@ -247,9 +249,41 @@ func (c *CriManager) Status(ctx context.Context, r *runtime.StatusRequest) (*run
return nil, fmt.Errorf("Status Not Implemented Yet")
}

func imageToRuntimeAPIImage(image *apitypes.ImageInfo) (*runtime.Image, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comment for this function?
Actually I have no strong idea about RuntimeAPIImage.
Thanks. 😄

@codecov-io
Copy link

codecov-io commented Jan 2, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@e836ce1). Click here to learn what that means.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #477   +/-   ##
=========================================
  Coverage          ?   19.07%           
=========================================
  Files             ?       34           
  Lines             ?     1693           
  Branches          ?        0           
=========================================
  Hits              ?      323           
  Misses            ?     1335           
  Partials          ?       35
Impacted Files Coverage Δ
daemon/mgr/cri.go 0% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e836ce1...f8de509. Read the comment docs.

@allencloud allencloud added this to the v0.1-Milestone milestone Jan 2, 2018
@YaoZengzeng YaoZengzeng force-pushed the pull-list-images branch 3 times, most recently from abcb4d1 to dc1df7b Compare January 2, 2018 09:07
@YaoZengzeng
Copy link
Contributor Author

@allencloud updated.

@@ -259,7 +294,24 @@ func (c *CriManager) ImageStatus(ctx context.Context, r *runtime.ImageStatusRequ

// PullImage pulls an image with authentication config.
func (c *CriManager) PullImage(ctx context.Context, r *runtime.PullImageRequest) (*runtime.PullImageResponse, error) {
return nil, fmt.Errorf("PullImage Not Implemented Yet")
// TODO: authentication.
imageRef := r.GetImage().GetImage()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes feel weird, although it is correct totally. 😄
double GetImage().

@allencloud
Copy link
Collaborator

LGTM, I think we could begin considering adding API integration test. @YaoZengzeng @Letty5411

@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Jan 2, 2018
@allencloud allencloud merged commit ac2f067 into AliyunContainerService:master Jan 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature LGTM one maintainer or community participant agrees to merge the pull reuqest. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants