From ea9ed9c658aab075b9e2b64dbe48ed04732fa90b Mon Sep 17 00:00:00 2001 From: slinkydeveloper Date: Tue, 12 Jan 2021 10:47:38 +0100 Subject: [PATCH] Removed WithChecker because it doesn't exist anymore Signed-off-by: Francesco Guardiani --- pkg/kncloudevents/message_receiver.go | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/pkg/kncloudevents/message_receiver.go b/pkg/kncloudevents/message_receiver.go index 4ca1c2d0843..af59e5a3470 100644 --- a/pkg/kncloudevents/message_receiver.go +++ b/pkg/kncloudevents/message_receiver.go @@ -37,8 +37,6 @@ type HTTPMessageReceiver struct { server *http.Server listener net.Listener - - checker http.HandlerFunc } // HTTPMessageReceiverOption enables further configuration of a HTTPMessageReceiver. @@ -54,16 +52,6 @@ func NewHTTPMessageReceiver(port int, o ...HTTPMessageReceiverOption) *HTTPMessa return h } -// WithChecker takes a handler func which will run as an additional health check in Drainer. -// kncloudevents HTTPMessageReceiver uses Drainer to perform health check. -// By default, Drainer directly writes StatusOK to kubelet probe if the Pod is not draining. -// Users can configure customized liveness and readiness check logic by defining checker here. -func WithChecker(checker http.HandlerFunc) HTTPMessageReceiverOption { - return func(h *HTTPMessageReceiver) { - h.checker = checker - } -} - // Blocking func (recv *HTTPMessageReceiver) StartListen(ctx context.Context, handler http.Handler) error { var err error @@ -72,8 +60,7 @@ func (recv *HTTPMessageReceiver) StartListen(ctx context.Context, handler http.H } drainer := &handlers.Drainer{ - Inner: CreateHandler(handler), - HealthCheck: recv.checker, + Inner: CreateHandler(handler), } recv.server = &http.Server{ Addr: recv.listener.Addr().String(),