Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Adding a check if the container is still being monitord before readin… #306

Merged
merged 4 commits into from
Jun 5, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pkg/containerwatcher/v1/container_watcher_private.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ func (ch *IGContainerWatcher) containerCallback(notif containercollection.PubSub
// Read the syscall tracer events in a separate goroutine.
go func() {
for {
if !ch.timeBasedContainers.Contains(notif.Container.Runtime.ContainerID) && !ch.preRunningContainersIDs.Contains(notif.Container.Runtime.ContainerID) {
logger.L().Info("stop monitor on container - container has been removed",
helpers.String("container ID", notif.Container.Runtime.ContainerID),
helpers.String("k8s workload", k8sContainerID))
return
}

evs, err := ch.syscallTracer.Read(notif.Container.Runtime.ContainerID)
if err != nil {
logger.L().Debug("syscalls perf buffer closed", helpers.String("error", err.Error()))
Expand Down
Loading