Merge pull request #10154 from wy65701436/fix-10092-cp

[cherry-pick] improve pulling vulnerable images warning message
This commit is contained in:
Wenkai Yin(尹文开) 2019-12-06 13:56:13 +08:00 committed by GitHub
commit dda6f638a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}