Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

watcher: Don't create service and podInfo informers #2167

Merged
merged 3 commits into from
Mar 1, 2024

Conversation

lambdanis
Copy link
Contributor

@lambdanis lambdanis commented Feb 29, 2024

Cleaning up unused code related to service and podInfo informers.

I also refactored how informers are created in K8sWatcher, so that it's easier to add additional informers if needed.

@lambdanis lambdanis force-pushed the pr/lambdanis/watcher branch 7 times, most recently from b8b1451 to d62f19f Compare February 29, 2024 17:32
@lambdanis lambdanis added area/userspace Related to userspace Tetragon logic release-note/misc This PR makes changes that have no direct user impact. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Feb 29, 2024
@lambdanis lambdanis force-pushed the pr/lambdanis/watcher branch 2 times, most recently from 2a2a2dd to 05b1240 Compare February 29, 2024 18:02
@lambdanis lambdanis changed the title [WIP] watcher: Refactor K8sWatcher watcher: Refactor how informers are created in K8sWatcher Feb 29, 2024
Instead of defining each informer as a separate field in K8sWatcher, define
informers map as well as AddInformers and GetInformer methods (to populate the
map and retrieve informers). This also required changing how the watcher is
started - K8sWatcher now contains startFunc function, which is extended in
AddInformers method and called in NewK8sWatcherWithTetragonClient.

This refactoring will make it easier to extend the watcher with additional
informers or to clean them up if needed.

Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
They are unused. I also merged NewK8sWatcherWithTetragonClient function into
NewK8sWatcher and deleted unused code related to these informers.

Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
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>
@lambdanis lambdanis force-pushed the pr/lambdanis/watcher branch from 05b1240 to f4e1524 Compare February 29, 2024 18:05
@lambdanis lambdanis changed the title watcher: Refactor how informers are created in K8sWatcher watcher: Don't create service and podInfo informers Feb 29, 2024
@lambdanis lambdanis marked this pull request as ready for review February 29, 2024 18:07
@lambdanis lambdanis requested a review from a team as a code owner February 29, 2024 18:07
@lambdanis lambdanis requested a review from olsajiri February 29, 2024 18:07
@lambdanis lambdanis merged commit da91e33 into main Mar 1, 2024
35 checks passed
@lambdanis lambdanis deleted the pr/lambdanis/watcher branch March 1, 2024 10:34
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area/userspace Related to userspace Tetragon logic kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants