mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-25 03:35:21 +01:00
Update proxy cache to serve the image in local when it is removed in upstream
Add stacktrace in debug log Signed-off-by: stonezdj <stone.zhang@broadcom.com>
This commit is contained in:
parent
f86f1cebc3
commit
796c18a6ab
@ -172,9 +172,9 @@ func (c *controller) UseLocalManifest(ctx context.Context, art lib.ArtifactInfo,
|
||||
return false, nil, err
|
||||
}
|
||||
if !exist || desc == nil {
|
||||
return false, nil, errors.NotFoundError(fmt.Errorf("repo %v, tag %v not found", art.Repository, art.Tag))
|
||||
log.Warningf("repo %v, tag %v not found in remote, fallback to local", art.Repository, art.Tag)
|
||||
return true, nil, nil
|
||||
}
|
||||
|
||||
var content []byte
|
||||
var contentType string
|
||||
if c.cache == nil {
|
||||
|
@ -59,7 +59,7 @@ func SendError(w http.ResponseWriter, err error) {
|
||||
errPayload = errors.NewErrs(err).Error()
|
||||
} else {
|
||||
// only log the error whose status code < 500 when debugging to avoid log flooding
|
||||
log.Debug(errPayload)
|
||||
log.Debugf("%s %s", errPayload, stackTrace)
|
||||
}
|
||||
w.WriteHeader(statusCode)
|
||||
fmt.Fprintln(w, errPayload)
|
||||
|
Loading…
Reference in New Issue
Block a user