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

bugfix: distinguish NotFound error with others about image #2139

Merged

Conversation

starnop
Copy link
Contributor

@starnop starnop commented Aug 22, 2018

Signed-off-by: Starnop starnop@163.com

Ⅰ. Describe what this PR did

distinguish NotFound error with others about image

Ⅱ. Does this pull request fix one issue?

None.

Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@pouchrobot pouchrobot added kind/bug This is bug report for project size/M labels Aug 22, 2018
@starnop starnop force-pushed the image-error-not-found branch 2 times, most recently from fc3fdc1 to fb25945 Compare August 22, 2018 08:06
@allencloud
Copy link
Collaborator

allencloud commented Aug 22, 2018

Please try to use failed to do something when constructing error or log. @starnop

And CI fails, both of the cri-tools testing.

@starnop starnop changed the title bugfix: distinguish NotFound error with others about image [WIP]bugfix: distinguish NotFound error with others about image Aug 22, 2018
// TODO: separate ErrImageNotFound with others.
// Now we just return empty if the error occurred.
return &runtime.ImageStatusResponse{}, nil
if errtypes.IsNotfound(err) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why return nil error here? could we check the IsNotfound out of this scope?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The CRI API declares this :

ImageStatus returns the status of the image. If the image is not present, returns a response with ImageStatusResponse.Image set to nil.

@starnop starnop force-pushed the image-error-not-found branch 4 times, most recently from 400e7dd to 419de77 Compare August 22, 2018 12:14
@starnop starnop changed the title [WIP]bugfix: distinguish NotFound error with others about image bugfix: distinguish NotFound error with others about image Aug 22, 2018
@codecov-io
Copy link

codecov-io commented Aug 22, 2018

Codecov Report

Merging #2139 into master will increase coverage by 0.03%.
The diff coverage is 60%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2139      +/-   ##
==========================================
+ Coverage   64.38%   64.42%   +0.03%     
==========================================
  Files         209      209              
  Lines       16631    16639       +8     
==========================================
+ Hits        10708    10719      +11     
+ Misses       4595     4593       -2     
+ Partials     1328     1327       -1
Flag Coverage Δ
#criv1alpha1test 32.99% <25%> (+0.03%) ⬆️
#criv1alpha2test 33.6% <35%> (+0.03%) ⬆️
#integrationtest 39.24% <0%> (-0.01%) ⬇️
#unittest 23.89% <0%> (-0.02%) ⬇️
Impacted Files Coverage Δ
cri/v1alpha1/cri_utils.go 83.22% <50%> (-0.12%) ⬇️
cri/v1alpha2/cri_utils.go 82.26% <50%> (-0.1%) ⬇️
cri/v1alpha1/cri.go 63.65% <66.66%> (-0.05%) ⬇️
cri/v1alpha2/cri.go 65.04% <80%> (+0.28%) ⬆️
cri/stream/httpstream/spdy/upgrade.go 54.28% <0%> (-5.72%) ⬇️
daemon/containerio/container_io.go 73.48% <0%> (-1.11%) ⬇️
daemon/mgr/container.go 56.86% <0%> (+0.41%) ⬆️
ctrd/image.go 77.19% <0%> (+2.19%) ⬆️

@@ -18,6 +18,7 @@ import (
"github.com/alibaba/pouch/daemon/mgr"
"github.com/alibaba/pouch/pkg/utils"

"github.com/alibaba/pouch/pkg/errtypes"
Copy link
Contributor

Choose a reason for hiding this comment

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

pouch own pkg should not put with the third party pakcage

@@ -18,6 +18,7 @@ import (
"github.com/alibaba/pouch/daemon/mgr"
"github.com/alibaba/pouch/pkg/utils"

"github.com/alibaba/pouch/pkg/errtypes"
Copy link
Contributor

Choose a reason for hiding this comment

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

pouch own pkg should not put with the third party pakcage

}

return nil
return fmt.Errorf("failed to checkReference sandbox image %q: %v", imageRef, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should use other word instead of checkReference. how about failed to check sanbox image?

@allencloud
Copy link
Collaborator

LGTM until fix some import sequence. @starnop

@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Aug 23, 2018
Signed-off-by: Starnop <starnop@163.com>
@starnop starnop force-pushed the image-error-not-found branch from 419de77 to 4b63b11 Compare August 23, 2018 02:40
@allencloud allencloud merged commit c896eec into AliyunContainerService:master Aug 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This is bug report for project 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.

6 participants