diff --git a/pkg/kncloudevents/message_receiver.go b/pkg/kncloudevents/message_receiver.go index 4ca1c2d0843..76342148e37 100644 --- a/pkg/kncloudevents/message_receiver.go +++ b/pkg/kncloudevents/message_receiver.go @@ -54,16 +54,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 +62,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(),