Remove user agent check for docker notifications

Fixes #5729

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke 2019-01-03 21:15:42 +01:00
parent 75d45ebd9d
commit 8b65e4f424
No known key found for this signature in database
GPG Key ID: 3F619F17002790D8

View File

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