Allow to selects events from pods with specific labels #120
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Type:
Enhancement
PR Description:
This PR introduces a new feature that allows the node-agent to monitor only specific pods that match certain labels. This is achieved by adding a new configuration parameter that allows specifying these labels. The changes mainly affect the container watcher and the configuration files.
PR Main Files Walkthrough:
pkg/containerwatcher/v1/container_watcher.go
: The changes in this file allow the container watcher to filter and select events from pods that match the specified labels. If the labels are specified in the configuration, they are used to create a container selector. This selector is then used when adding tracers for exec and open events.pkg/config/config.go
: A new fieldPodWatchLabels
of type map[string]string is added to the Config struct. This field is used to store the labels that will be used to select the pods to monitor.go.sum
: The dependencies in the go.sum file are updated to include new packages that are used in the implementation of the new feature.go.mod
: The go.mod file is updated to include the new dependencies that are used in the implementation of the new feature.User Description:
Overview
I would like to use node-agent only on some pod matching some specific labels. Thus, I've added a parameter which permits to specify those labels.
Checklist before requesting a review
put an [x] in the box to get it checked
Please open the PR against the
dev
branch (Unless the PR contains only documentation changes)There's no
dev
branch :-)