-
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
bugfix: distinguish NotFound error with others about image #2139
bugfix: distinguish NotFound error with others about image #2139
Conversation
fc3fdc1
to
fb25945
Compare
Please try to use And CI fails, both of the cri-tools testing. |
// TODO: separate ErrImageNotFound with others. | ||
// Now we just return empty if the error occurred. | ||
return &runtime.ImageStatusResponse{}, nil | ||
if errtypes.IsNotfound(err) { |
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.
why return nil error here? could we check the IsNotfound out of this scope?
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.
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.
400e7dd
to
419de77
Compare
Codecov Report
@@ 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
|
cri/v1alpha1/cri_utils.go
Outdated
@@ -18,6 +18,7 @@ import ( | |||
"github.com/alibaba/pouch/daemon/mgr" | |||
"github.com/alibaba/pouch/pkg/utils" | |||
|
|||
"github.com/alibaba/pouch/pkg/errtypes" |
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.
pouch own pkg should not put with the third party pakcage
cri/v1alpha2/cri_utils.go
Outdated
@@ -18,6 +18,7 @@ import ( | |||
"github.com/alibaba/pouch/daemon/mgr" | |||
"github.com/alibaba/pouch/pkg/utils" | |||
|
|||
"github.com/alibaba/pouch/pkg/errtypes" |
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.
pouch own pkg should not put with the third party pakcage
cri/v1alpha1/cri_utils.go
Outdated
} | ||
|
||
return nil | ||
return fmt.Errorf("failed to checkReference sandbox image %q: %v", imageRef, err) |
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 we should use other word instead of checkReference
. how about failed to check sanbox image
?
LGTM until fix some import sequence. @starnop |
Signed-off-by: Starnop <starnop@163.com>
419de77
to
4b63b11
Compare
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