Skip to content

Commit

Permalink
ignore all node-agent pods
Browse files Browse the repository at this point in the history
Signed-off-by: Ben <ben@armosec.io>
  • Loading branch information
slashben committed Aug 15, 2024
1 parent c566f42 commit ee276d5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/containerwatcher/v1/container_watcher_private.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import (
"context"
"errors"
"fmt"
"os"
"runtime"
"strings"
"time"

containercollection "github.com/inspektor-gadget/inspektor-gadget/pkg/container-collection"
Expand Down Expand Up @@ -381,6 +383,12 @@ func (ch *IGContainerWatcher) ignoreContainer(namespace, name string) bool {
if name == ch.podName && namespace == ch.namespace {
return true
}
// do not trace the node-agent pods if MULTIPLY is set
if m := os.Getenv("MULTIPLY"); m == "true" {
if strings.HasPrefix(name, "node-agent") {
return true
}
}
// check if config excludes the namespace
return ch.cfg.SkipNamespace(namespace)
}

0 comments on commit ee276d5

Please sign in to comment.