-
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: convert container err into pouchd manager error #2034
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2034 +/- ##
==========================================
+ Coverage 64.05% 64.06% +0.01%
==========================================
Files 202 202
Lines 15510 15588 +78
==========================================
+ Hits 9935 9987 +52
- Misses 4338 4352 +14
- Partials 1237 1249 +12
|
ctrd/image.go
Outdated
@@ -170,6 +220,9 @@ func (c *Client) PullImage(ctx context.Context, ref string, authConfig *types.Au | |||
|
|||
// start to pull image. | |||
img, err := c.pullImage(ctx, wrapperCli, ref, options) | |||
if err != nil { |
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.
we don't need to convert err here. the error is in the jsonstream message, not http status
ctrd/utils.go
Outdated
"github.com/alibaba/pouch/pkg/utils" | ||
"github.com/pkg/errors" |
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.
move it into next group
} | ||
|
||
if errdefs.IsAlreadyExists(err) { | ||
return errors.Wrap(errtypes.ErrAlreadyExisted, err.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.
it;s ok to have duplicate error message. we might find the way to hack it and remove the duplicated message
002144c
to
e6141d0
Compare
Signed-off-by: Allen Sun <allensun.shl@alibaba-inc.com>
ping @fuweid 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.
LGTM
Signed-off-by: Allen Sun allensun.shl@alibaba-inc.com
Ⅰ. Describe what this PR did
This pull request converts the error from containerd side to pouch manager side.
For the error part, we have the following part:
github.com/containerd/containerd/errdefs
github.com/alibaba/pouch/pkg/errtypes
, this is used for API layers to construct http status code in./apis/server/routes.go
So if we need to make use of error returned from containerd client which is
ctrd
, then we should convert those errors into errtypes which could be used in mgrs. This will transfer errors from containerd correctly to mgrs and API layers.Ⅱ. Does this pull request fix one issue?
none
Ⅲ. Describe how you did it
none
Ⅳ. Describe how to verify it
none
Ⅴ. Special notes for reviews
none