-
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
refactor: add more error information #2055
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2055 +/- ##
==========================================
+ Coverage 59.05% 63.95% +4.89%
==========================================
Files 202 202
Lines 15494 15535 +41
==========================================
+ Hits 9150 9935 +785
+ Misses 5233 4360 -873
- Partials 1111 1240 +129
|
if err != nil { | ||
return "", err | ||
logrus.Errorf("failed to remount grpquota, mountpoint: (%s), stdout: (%s), stderr: (%s), exit: (%d), err: (%v)", |
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.
maybe errMsg := fmt.Sprintf("failed to remount grpquota, mountpoint: (%s), stdout: (%s), stderr: (%s), exit: (%d), err: (%v)", ...)
storage/quota/grpquota.go
Outdated
return mountPoint, err | ||
logrus.Errorf("failed to setquota, stdout: (%s), stderr: (%s), exit: (%d), err: (%v)", | ||
stdout, stderr, exit, err) | ||
return mountPoint, errors.Wrapf(err, "failed to setquota, stdout: (%s), stderr: (%s), exit: (%d)") |
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.
missing params
Add more error information in quota package. Signed-off-by: Rudy Zhang <rudyflyzhang@gmail.com>
lgtm |
@@ -2321,7 +2321,9 @@ func (mgr *ContainerManager) setMountPointDiskQuota(ctx context.Context, c *Cont | |||
} | |||
err := quota.SetDiskQuota(mp.Source, size, qid) | |||
if err != nil { | |||
return err | |||
// just ignore set disk quota fail |
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.
@rudyfly could we add reason at here, since there is no information about why we ignore the 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.
Because of the different environment problems, setting disk quota may be failed, in order to start container successfully, so we ignore the errors that cause by diskquota's tools.
Ⅰ. Describe what this PR did
Add more error information in quota package.
Ⅱ. Does this pull request fix one issue?
Ⅲ. Describe how you did it
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews
Signed-off-by: Rudy Zhang rudyflyzhang@gmail.com