Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Bertschy <[email protected]>
  • Loading branch information
matthyx committed Nov 20, 2024
1 parent 4fb52bf commit fd89bec
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions pkg/containerwatcher/v1/container_watcher_private.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import (
"time"

containercollection "github.com/inspektor-gadget/inspektor-gadget/pkg/container-collection"
containerutils "github.com/inspektor-gadget/inspektor-gadget/pkg/container-utils/types"
"github.com/inspektor-gadget/inspektor-gadget/pkg/socketenricher"
"github.com/inspektor-gadget/inspektor-gadget/pkg/types"
"github.com/inspektor-gadget/inspektor-gadget/pkg/utils/host"
"github.com/kubescape/go-logger"
"github.com/kubescape/go-logger/helpers"
Expand All @@ -36,7 +38,11 @@ func (ch *IGContainerWatcher) containerCallback(notif containercollection.PubSub

switch notif.Type {
case containercollection.EventTypeAddContainer:
logger.L().Info("start monitor on container", helpers.String("container ID", notif.Container.Runtime.ContainerID), helpers.String("k8s workload", k8sContainerID))
logger.L().Info("start monitor on container",
helpers.String("container ID", notif.Container.Runtime.ContainerID),
helpers.String("k8s workload", k8sContainerID),
helpers.String("ContainerImageDigest", notif.Container.Runtime.ContainerImageDigest),
helpers.String("ContainerImageName", notif.Container.Runtime.ContainerImageName))
if ch.running {
ch.timeBasedContainers.Add(notif.Container.Runtime.ContainerID)
} else {
Expand Down Expand Up @@ -108,7 +114,11 @@ func (ch *IGContainerWatcher) startContainerCollection(ctx context.Context) erro
containercollection.WithLinuxNamespaceEnrichment(),

// Get containers created with container runtimes
containercollection.WithContainerRuntimeEnrichment(ch.runtime),
containercollection.WithMultipleContainerRuntimesEnrichment(
[]*containerutils.RuntimeConfig{
{Name: types.RuntimeNameDocker},
{Name: types.RuntimeNameContainerd},
}),

// Get containers created with ebpf (works also if hostPid=false)
containercollection.WithContainerFanotifyEbpf(),
Expand Down

0 comments on commit fd89bec

Please sign in to comment.