Skip to content

Commit fc34681

Browse files
committed
bugfix: fail to execute repquota
When fail to execute `reqquota`, return quota id is 0, instead of `QuotaMinID` Signed-off-by: Rudy Zhang <[email protected]>
1 parent 318aad0 commit fc34681

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

storage/quota/quota.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"github.com/alibaba/pouch/pkg/exec"
1414
"github.com/alibaba/pouch/pkg/kernel"
1515

16+
"github.com/pkg/errors"
1617
"github.com/sirupsen/logrus"
1718
)
1819

@@ -289,9 +290,10 @@ func loadQuotaIDs(repquotaOpt string) (map[uint32]struct{}, uint32, error) {
289290
quotaIDs := make(map[uint32]struct{}, 0)
290291

291292
minID := QuotaMinID
292-
_, output, _, err := exec.Run(0, "repquota", repquotaOpt)
293+
exit, output, stderr, err := exec.Run(0, "repquota", repquotaOpt)
293294
if err != nil {
294-
return nil, minID, err
295+
return nil, 0, errors.Wrapf(err, "failed to execute [repquota %s], stdout: (%s), stderr: (%s), exit: (%d)",
296+
repquotaOpt, output, stderr, exit)
295297
}
296298

297299
lines := strings.Split(string(output), "\n")

0 commit comments

Comments
 (0)