From 929e618935c6d1c8a751b0d61f7fdb69fe6ef886 Mon Sep 17 00:00:00 2001 From: "Eric R. Rath" Date: Mon, 27 Feb 2023 12:34:16 -0800 Subject: [PATCH] --events controls CRD informer creation mgruener suggested that the --events flag could be wired to control whether or not the CRD source created and started its informer. This commit makes that change; good idea! --- main.go | 1 + source/store.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 3ef760edb..4347c546f 100644 --- a/main.go +++ b/main.go @@ -133,6 +133,7 @@ func main() { RequestTimeout: cfg.RequestTimeout, DefaultTargets: cfg.DefaultTargets, OCPRouterName: cfg.OCPRouterName, + UpdateEvents: cfg.UpdateEvents, } // Lookup all the selected sources by names and pass them the desired configuration. diff --git a/source/store.go b/source/store.go index da7ce2a65..9194030b2 100644 --- a/source/store.go +++ b/source/store.go @@ -69,6 +69,7 @@ type Config struct { RequestTimeout time.Duration DefaultTargets []string OCPRouterName string + UpdateEvents bool } // ClientGenerator provides clients @@ -270,8 +271,7 @@ func BuildWithConfig(ctx context.Context, source string, p ClientGenerator, cfg if err != nil { return nil, err } - startInformer := true - return NewCRDSource(crdClient, cfg.Namespace, cfg.CRDSourceKind, cfg.AnnotationFilter, cfg.LabelFilter, scheme, startInformer) + return NewCRDSource(crdClient, cfg.Namespace, cfg.CRDSourceKind, cfg.AnnotationFilter, cfg.LabelFilter, scheme, cfg.UpdateEvents) case "skipper-routegroup": apiServerURL := cfg.APIServerURL tokenPath := ""