mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-01 08:09:59 +01:00
improve pulling vulnerable images warning message
To make the message more friendly and readable for the end-user Signed-off-by: wang yan <wangyan@vmware.com>
This commit is contained in:
parent
bd28ad1ae7
commit
1ea5ed0381
@ -92,7 +92,8 @@ func (vh vulnerableHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)
|
||||
|
||||
// Do judgement
|
||||
if summary.Severity.Code() >= projectVulnerableSeverity.Code() {
|
||||
err = errors.Errorf("the pulling image severity %q is higher than or equal with the project setting %q, reject the response.", summary.Severity, projectVulnerableSeverity)
|
||||
err = errors.Errorf("current image with '%q vulnerable' cannot be pulled due to configured policy in 'Prevent images with vulnerability severity of %q from running.' "+
|
||||
"Please contact your project administrator for help'", summary.Severity, projectVulnerableSeverity)
|
||||
vh.sendError(err, rw)
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user