Skip to content

Commit

Permalink
Remove user agent check for docker notifications
Browse files Browse the repository at this point in the history
Fixes #5729

Signed-off-by: Jan-Otto Kröpke <[email protected]>
  • Loading branch information
jkroepke committed Jan 3, 2019
1 parent 75d45eb commit 8b65e4f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/core/service/notifications/registry/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 8b65e4f

Please sign in to comment.