Skip to content

Commit

Permalink
Removed WithChecker because it doesn't exist anymore
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
  • Loading branch information
slinkydeveloper committed Jan 12, 2021
1 parent 0af2917 commit 08168be
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions pkg/kncloudevents/message_receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(),
Expand Down

0 comments on commit 08168be

Please sign in to comment.