From f3b22acfec9873f12c4ae9a68786511079e320c4 Mon Sep 17 00:00:00 2001 From: Ta-Ching Chen Date: Sat, 28 Sep 2019 17:43:04 +0800 Subject: [PATCH] Fix router health route not found if no HTTP triggers created (#1333) Router readiness probe failed due to kubelet cannot find router healthz endpoint. This is caused that the healthz endpoint is added only when there is any update request send to the updateRouterRequestChannel, and makes router failed. This PR sends an update request right before the router is started to avoid the problem. --- pkg/router/httpTriggers.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/router/httpTriggers.go b/pkg/router/httpTriggers.go index d63b1f89d..6b1296ea2 100644 --- a/pkg/router/httpTriggers.go +++ b/pkg/router/httpTriggers.go @@ -71,7 +71,7 @@ func makeHTTPTriggerSet(logger *zap.Logger, fmap *functionServiceMap, frmap *fun kubeClient: kubeClient, executor: executor, crdClient: crdClient, - updateRouterRequestChannel: make(chan struct{}), + updateRouterRequestChannel: make(chan struct{}, 10), // use buffer channel tsRoundTripperParams: params, isDebugEnv: isDebugEnv, svcAddrUpdateThrottler: actionThrottler, @@ -103,6 +103,7 @@ func (ts *HTTPTriggerSet) subscribeRouter(ctx context.Context, mr *mutableRouter return } go ts.updateRouter() + go ts.syncTriggers() go ts.runWatcher(ctx, ts.funcController) go ts.runWatcher(ctx, ts.triggerController) if ts.recorderSet.recController != nil {