Added ignore event typs into notifications
Signed-off-by: elsanli(李楠) <elsanli@tencent.com>
This commit is contained in:
parent
5cb406d511
commit
fc1d3647c6
7 changed files with 84 additions and 20 deletions
|
@ -1,6 +1,7 @@
|
|||
package notifications
|
||||
|
||||
import (
|
||||
"github.com/docker/distribution/configuration"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
@ -14,6 +15,7 @@ type EndpointConfig struct {
|
|||
Backoff time.Duration
|
||||
IgnoredMediaTypes []string
|
||||
Transport *http.Transport `json:"-"`
|
||||
Ignore configuration.Ignore
|
||||
}
|
||||
|
||||
// defaults set any zero-valued fields to a reasonable default.
|
||||
|
@ -63,7 +65,8 @@ func NewEndpoint(name, url string, config EndpointConfig) *Endpoint {
|
|||
endpoint.Transport, endpoint.metrics.httpStatusListener())
|
||||
endpoint.Sink = newRetryingSink(endpoint.Sink, endpoint.Threshold, endpoint.Backoff)
|
||||
endpoint.Sink = newEventQueue(endpoint.Sink, endpoint.metrics.eventQueueListener())
|
||||
endpoint.Sink = newIgnoredMediaTypesSink(endpoint.Sink, config.IgnoredMediaTypes)
|
||||
mediaTypes := append(config.Ignore.MediaTypes, config.IgnoredMediaTypes...)
|
||||
endpoint.Sink = newIgnoredSink(endpoint.Sink, mediaTypes, config.Ignore.Actions)
|
||||
|
||||
register(&endpoint)
|
||||
return &endpoint
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue