mirror of
https://github.com/goharbor/harbor
synced 2024-09-20 23:59:56 +00:00
Merge pull request #14629 from steven-zou/fix/job_log_not_found_issue_2.2
fix(js):job log not found issue
This commit is contained in:
commit
cf756802b0
|
@ -133,12 +133,7 @@ func (bc *basicController) GetJobLogData(jobID string) ([]byte, error) {
|
|||
return nil, errs.BadRequestError(errors.New("empty job ID"))
|
||||
}
|
||||
|
||||
logData, err := logger.Retrieve(jobID)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "error for getting log of job %s", jobID)
|
||||
}
|
||||
|
||||
return logData, nil
|
||||
return logger.Retrieve(jobID)
|
||||
}
|
||||
|
||||
// CheckStatus is implementation of same method in core interface.
|
||||
|
|
|
@ -2,7 +2,10 @@ package getter
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/goharbor/harbor/src/common/dao"
|
||||
"github.com/goharbor/harbor/src/jobservice/errs"
|
||||
)
|
||||
|
||||
// DBGetter is responsible for retrieving DB log data
|
||||
|
@ -22,7 +25,8 @@ func (dbg *DBGetter) Retrieve(logID string) ([]byte, error) {
|
|||
|
||||
jobLog, err := dao.GetJobLog(logID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
// Other errors have been ignored by GetJobLog()
|
||||
return nil, errs.NoObjectFoundError(fmt.Sprintf("log entity: %s", logID))
|
||||
}
|
||||
|
||||
return []byte(jobLog.Content), nil
|
||||
|
|
Loading…
Reference in New Issue
Block a user