From 8b65e4f424d41cfb8d30412c90c80cbfa6e75358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Thu, 3 Jan 2019 21:15:42 +0100 Subject: [PATCH] Remove user agent check for docker notifications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #5729 Signed-off-by: Jan-Otto Kröpke --- src/core/service/notifications/registry/handler.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/service/notifications/registry/handler.go b/src/core/service/notifications/registry/handler.go index a30141c7f1d..cada29d8571 100644 --- a/src/core/service/notifications/registry/handler.go +++ b/src/core/service/notifications/registry/handler.go @@ -173,12 +173,11 @@ func filterEvents(notification *models.Notification) ([]*models.Event, error) { } func checkEvent(event *models.Event) bool { - // pull and push manifest by docker-client or vic or jib - if (strings.HasPrefix(event.Request.UserAgent, "docker") || strings.HasPrefix(event.Request.UserAgent, vicPrefix) || strings.HasPrefix(event.Request.UserAgent, "jib")) && - (event.Action == "pull" || event.Action == "push") { + // pull and push manifest + if strings.ToLower(strings.TrimSpace(event.Request.UserAgent)) != "harbor-registry-client" && (event.Action == "pull" || event.Action == "push") { return true } - // push manifest by docker-client or job-service + // push manifest by job-service if strings.ToLower(strings.TrimSpace(event.Request.UserAgent)) == "harbor-registry-client" && event.Action == "push" { return true }