Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobTanenbaum committed Dec 19, 2024
1 parent 12f4564 commit 28357ec
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pkg/resourcewatch/controller/configmonitor/crd_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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{}) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/resourcewatch/operator/starter.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func RunResourceWatch() error {
return err
}

repositoryPath := "/repository"
repositoryPath := "./repository"
if repositoryPathEnv := os.Getenv("REPOSITORY_PATH"); len(repositoryPathEnv) > 0 {
repositoryPath = repositoryPathEnv
}
Expand Down
4 changes: 4 additions & 0 deletions pkg/resourcewatch/storage/git_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
}()
}
Expand Down

0 comments on commit 28357ec

Please sign in to comment.