From 317149160da17e3af9cd5015629661791c81c21a Mon Sep 17 00:00:00 2001 From: wang yan Date: Thu, 5 Dec 2019 11:36:00 +0800 Subject: [PATCH] improve pulling vulnerable images warning message To make the message more friendly and readable for the end-user Signed-off-by: wang yan --- src/core/middlewares/vulnerable/handler.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/middlewares/vulnerable/handler.go b/src/core/middlewares/vulnerable/handler.go index f76989d8b..5af111df3 100644 --- a/src/core/middlewares/vulnerable/handler.go +++ b/src/core/middlewares/vulnerable/handler.go @@ -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 }