From 4f54af52998553dc6e7b62494e3ede5b9be2a313 Mon Sep 17 00:00:00 2001 From: Sebastian Florek Date: Wed, 18 Sep 2024 15:50:49 +0200 Subject: [PATCH] cleanup --- cmd/agent/main.go | 2 -- pkg/cache/gate_cache.go | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/agent/main.go b/cmd/agent/main.go index 35b6e730..d6d5b608 100644 --- a/cmd/agent/main.go +++ b/cmd/agent/main.go @@ -51,7 +51,6 @@ func main() { config := ctrl.GetConfigOrDie() ctx := ctrl.LoggerInto(ctrl.SetupSignalHandler(), setupLog) - // supervisor := supervisor.New(ctx) extConsoleClient := client.New(args.ConsoleUrl(), args.DeployToken()) discoveryClient := initDiscoveryClientOrDie(config) kubeManager := initKubeManagerOrDie(config) @@ -74,7 +73,6 @@ func main() { cache.RunDiscoveryCacheInBackgroundOrDie(ctx, discoveryClient) // Start the console manager in background. - // supervisor.AddFunc(runConsoleManagerInBackgroundOrDie(ctx, consoleManager)) runConsoleManagerInBackgroundOrDie(ctx, consoleManager) // Start the standard kubernetes manager and block the main thread until context cancel. diff --git a/pkg/cache/gate_cache.go b/pkg/cache/gate_cache.go index abb023e4..8007fcb2 100644 --- a/pkg/cache/gate_cache.go +++ b/pkg/cache/gate_cache.go @@ -13,6 +13,10 @@ var ( ) func InitGateCache(expireAfter time.Duration, consoleClient client.Client) { + if gateCache != nil { + return + } + gateCache = client.NewCache[console.PipelineGateFragment](expireAfter, func(id string) (*console.PipelineGateFragment, error) { return consoleClient.GetClusterGate(id) })