From 28357ec7774edc285cd48b5d9926705f8b004eeb Mon Sep 17 00:00:00 2001 From: Jacob Tanenbaum Date: Wed, 18 Dec 2024 13:03:28 -0500 Subject: [PATCH] testing --- pkg/resourcewatch/controller/configmonitor/crd_controller.go | 4 ++++ pkg/resourcewatch/operator/starter.go | 2 +- pkg/resourcewatch/storage/git_store.go | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/resourcewatch/controller/configmonitor/crd_controller.go b/pkg/resourcewatch/controller/configmonitor/crd_controller.go index ccfeed61c652..bb6a711eb7c6 100644 --- a/pkg/resourcewatch/controller/configmonitor/crd_controller.go +++ b/pkg/resourcewatch/controller/configmonitor/crd_controller.go @@ -4,6 +4,7 @@ import ( "k8s.io/client-go/dynamic/dynamicinformer" "k8s.io/klog/v2" + kapi "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/tools/cache" ) @@ -32,6 +33,9 @@ func WireResourceInformersToGitRepo( dynamicInformer.AddEventHandler( cache.ResourceEventHandlerFuncs{ AddFunc: func(obj interface{}) { + if pod, ok := obj.(*kapi.Pod); ok { + klog.Errorf("KEYWORD: got add for pod %s/%s", pod.Namespace, pod.Name) + } gitStorage.OnAdd(resourceToWatch, obj) }, UpdateFunc: func(oldObj, newObj interface{}) { diff --git a/pkg/resourcewatch/operator/starter.go b/pkg/resourcewatch/operator/starter.go index ae436760152b..da2c62c494d1 100644 --- a/pkg/resourcewatch/operator/starter.go +++ b/pkg/resourcewatch/operator/starter.go @@ -48,7 +48,7 @@ func RunResourceWatch() error { return err } - repositoryPath := "/repository" + repositoryPath := "./repository" if repositoryPathEnv := os.Getenv("REPOSITORY_PATH"); len(repositoryPathEnv) > 0 { repositoryPath = repositoryPathEnv } diff --git a/pkg/resourcewatch/storage/git_store.go b/pkg/resourcewatch/storage/git_store.go index 31452ee12e3b..263750253584 100644 --- a/pkg/resourcewatch/storage/git_store.go +++ b/pkg/resourcewatch/storage/git_store.go @@ -15,6 +15,7 @@ import ( "gopkg.in/src-d/go-git.v4" + kapi "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" @@ -228,6 +229,9 @@ func (s *GitStorage) OnUpdate(gvr schema.GroupVersionResource, oldObj, obj inter // start new go func to allow parallel processing where possible and to avoid blocking all progress on retries. go func() { defer s.currentlyRecording.release(key) + if pod, ok := obj.(*kapi.Pod); ok { + klog.Errorf("KEYWORD: starting goroutine for %s/%s", pod.Namespace, pod.Name) + } s.handle(gvr, oldObjUnstructured, objUnstructured, false) }() }