Skip to content

Commit

Permalink
use drainer from pkg instead of our own health
Browse files Browse the repository at this point in the history
  • Loading branch information
vaikas committed Aug 24, 2020
1 parent 31ef094 commit 979d9ad
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 107 deletions.
46 changes: 0 additions & 46 deletions pkg/health/probes.go

This file was deleted.

57 changes: 0 additions & 57 deletions pkg/health/probes_test.go

This file was deleted.

4 changes: 2 additions & 2 deletions pkg/mtbroker/filter/filter_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ import (
"go.opencensus.io/trace"
"go.uber.org/zap"
"knative.dev/pkg/logging"
"knative.dev/pkg/network/handlers"

eventingv1beta1 "knative.dev/eventing/pkg/apis/eventing/v1beta1"
eventinglisters "knative.dev/eventing/pkg/client/listers/eventing/v1beta1"
"knative.dev/eventing/pkg/health"
"knative.dev/eventing/pkg/kncloudevents"
broker "knative.dev/eventing/pkg/mtbroker"
"knative.dev/eventing/pkg/reconciler/sugar/trigger/path"
Expand Down Expand Up @@ -102,7 +102,7 @@ func NewHandler(logger *zap.Logger, triggerLister eventinglisters.TriggerLister,
//
// This method will block until ctx is done.
func (h *Handler) Start(ctx context.Context) error {
return h.receiver.StartListen(ctx, health.WithLivenessCheck(health.WithReadinessCheck(h)))
return h.receiver.StartListen(ctx, &handlers.Drainer{Inner: h})
}

// 1. validate request
Expand Down
4 changes: 2 additions & 2 deletions pkg/mtbroker/ingress/ingress_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ import (
"knative.dev/eventing/pkg/apis/eventing"
eventingv1 "knative.dev/eventing/pkg/apis/eventing/v1"
eventinglisters "knative.dev/eventing/pkg/client/listers/eventing/v1"
"knative.dev/eventing/pkg/health"
"knative.dev/eventing/pkg/kncloudevents"
broker "knative.dev/eventing/pkg/mtbroker"
"knative.dev/eventing/pkg/tracing"
"knative.dev/eventing/pkg/utils"
"knative.dev/pkg/network/handlers"
)

const (
Expand Down Expand Up @@ -96,7 +96,7 @@ func (h *Handler) getChannelAddress(name, namespace string) (string, error) {
}

func (h *Handler) Start(ctx context.Context) error {
return h.Receiver.StartListen(ctx, health.WithLivenessCheck(h))
return h.Receiver.StartListen(ctx, &handlers.Drainer{Inner: h})
}

func (h *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request) {
Expand Down

0 comments on commit 979d9ad

Please sign in to comment.