From e734fa3554ab7e1b9413b84147a4694f9d2e2c9a 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 d63b1f89..6b1296ea 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 {