Merge pull request #6689 from jkroepke/patch-1

Remove user agent check for docker notifications
This commit is contained in:
Wenkai Yin 2019-01-04 18:23:09 +08:00 committed by GitHub
commit f9c1a528cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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
}