Use Kubernetes informer and cache in router (#376)
Use Kubernetes client's informer and cache to watch functions and triggers in the router. This replaces the polling loop we were using so far.
This commit is contained in:
committed by
Soam Vasani
parent
8abb0005f6
commit
439e7d4535
+6
-1
@@ -77,9 +77,14 @@ func Start(port int, poolmgrUrl string) {
|
||||
if err != nil {
|
||||
log.Fatalf("Error connecting to kubernetes API: %v", err)
|
||||
}
|
||||
restClient := fissionClient.GetTprClient()
|
||||
poolmgr := poolmgrClient.MakeClient(poolmgrUrl)
|
||||
resolver := makeFunctionReferenceResolver(fissionClient)
|
||||
triggers := makeHTTPTriggerSet(fmap, fissionClient, poolmgr, resolver)
|
||||
resolver.Sync(restClient)
|
||||
defer func() {
|
||||
resolver.Stop()
|
||||
}()
|
||||
triggers := makeHTTPTriggerSet(fmap, fissionClient, poolmgr, resolver, restClient)
|
||||
log.Printf("Starting router at port %v\n", port)
|
||||
serve(port, triggers)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user