From 2465ba7a7456117355d1680a3526877c32d9194d Mon Sep 17 00:00:00 2001 From: Cedric McKinnie Date: Thu, 29 Jun 2023 14:38:09 -0400 Subject: [PATCH] Run with multiple namespaces --- pkg/triggers/watcher.go | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/pkg/triggers/watcher.go b/pkg/triggers/watcher.go index fb4071250bf..dab5bd8581b 100644 --- a/pkg/triggers/watcher.go +++ b/pkg/triggers/watcher.go @@ -62,19 +62,14 @@ func newK8sInformers(clientset kubernetes.Interface, testKubeClientset versioned k8sInformers.ingressInformers = append(k8sInformers.ingressInformers, f.Networking().V1().Ingresses()) k8sInformers.clusterEventInformers = append(k8sInformers.clusterEventInformers, f.Core().V1().Events()) k8sInformers.configMapInformers = append(k8sInformers.configMapInformers, f.Core().V1().ConfigMaps()) - } - var testkubeInformerFactory externalversions.SharedInformerFactory - if watchTestkubeCrAllNamespaces == true { - testkubeInformerFactory = externalversions.NewSharedInformerFactoryWithOptions( - testKubeClientset, 0) - } else { + var testkubeInformerFactory externalversions.SharedInformerFactory testkubeInformerFactory = externalversions.NewSharedInformerFactoryWithOptions( - testKubeClientset, 0, externalversions.WithNamespace(testkubeNamespace)) + testKubeClientset, 0, externalversions.WithNamespace(namespace)) + k8sInformers.testTriggerInformers = append(k8sInformers.testTriggerInformers, testkubeInformerFactory.Tests().V1().TestTriggers()) + k8sInformers.testSuiteInformers = append(k8sInformers.testSuiteInformers, testkubeInformerFactory.Tests().V2().TestSuites()) + k8sInformers.testInformers = append(k8sInformers.testInformers, testkubeInformerFactory.Tests().V3().Tests()) } - k8sInformers.testTriggerInformers = append(k8sInformers.testTriggerInformers, testkubeInformerFactory.Tests().V1().TestTriggers()) - k8sInformers.testSuiteInformers = append(k8sInformers.testSuiteInformers, testkubeInformerFactory.Tests().V2().TestSuites()) - k8sInformers.testInformers = append(k8sInformers.testInformers, testkubeInformerFactory.Tests().V3().Tests()) return &k8sInformers }