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 ea9ed9c
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions pkg/kncloudevents/message_receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ type HTTPMessageReceiver struct {

server *http.Server
listener net.Listener

checker http.HandlerFunc
}

// HTTPMessageReceiverOption enables further configuration of a HTTPMessageReceiver.
Expand All @@ -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
Expand All @@ -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(),
Expand Down

0 comments on commit ea9ed9c

Please sign in to comment.