Skip to content

Commit

Permalink
watcher: Don't start watcher in NewK8sWatcher
Browse files Browse the repository at this point in the history
[ upstream commit da91e33 ]

Since Start() is now an exported method of K8sWatcher, it makes sense to
separate responsibilities of creating and starting the watcher.

Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
  • Loading branch information
lambdanis authored and michi-covalent committed Apr 4, 2024
1 parent bd123c0 commit 6efaf89
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 1 addition & 0 deletions pkg/process/podinfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func TestK8sWatcher_GetPodInfo(t *testing.T) {

k8sClient := fake.NewSimpleClientset(&pod)
watcher := watcher.NewK8sWatcher(k8sClient, time.Hour)
watcher.Start()
pid := uint32(1)
podInfo := getPodInfo(watcher, "abcd1234", "curl", "cilium.io", 1)
assert.True(t, proto.Equal(podInfo, &tetragon.Pod{
Expand Down
2 changes: 0 additions & 2 deletions pkg/watcher/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ func NewK8sWatcher(k8sClient kubernetes.Interface, stateSyncIntervalSec time.Dur

podhooks.InstallHooks(podInformer)

k8sWatcher.Start()

return k8sWatcher
}

Expand Down

0 comments on commit 6efaf89

Please # to comment.