mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-17 04:11:24 +01:00
Remove user agent check for docker notifications
Fixes #5729 Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
parent
75d45ebd9d
commit
8b65e4f424
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user