containerwatcher

package
v0.3.336 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrContainerCollection = errors.New("starting container collection")

ErrContainerCollection wraps a Start failure of the container collection itself (no container discovery; an OnCollectionReady hook never ran).

Functions

This section is empty.

Types

type ContainerReceiver added in v0.2.145

type ContainerReceiver interface {
	ContainerCallback(notif containercollection.PubSubEvent)
}

type ContainerWatcher

type ContainerWatcher interface {
	Ready() bool
	Start(ctx context.Context) error
	Stop()
	// OnCollectionReady registers a hook Start runs once the container
	// collection is initialized, before any eBPF tracer starts. Start and the
	// eBPF tracers wait at most maxTracerDelay for it; the returned channel is
	// closed once it returned (or will never run).
	OnCollectionReady(fn func(), maxTracerDelay time.Duration) <-chan struct{}
	GetTracerCollection() *tracercollection.TracerCollection
	GetContainerCollection() *containercollection.ContainerCollection
	GetSocketEnricher() *socketenricher.SocketEnricher
	GetContainerSelector() *containercollection.ContainerSelector
	RegisterContainerReceiver(receiver ContainerReceiver)
	UnregisterContainerReceiver(receiver ContainerReceiver)
}

type ContainerWatcherMock

type ContainerWatcherMock struct{}

func (ContainerWatcherMock) GetContainerCollection added in v0.2.145

func (c ContainerWatcherMock) GetContainerCollection() *containercollection.ContainerCollection

func (ContainerWatcherMock) GetContainerSelector added in v0.2.145

func (ContainerWatcherMock) GetSocketEnricher added in v0.2.145

func (c ContainerWatcherMock) GetSocketEnricher() *socketenricher.SocketEnricher

func (ContainerWatcherMock) GetTracerCollection added in v0.2.145

func (c ContainerWatcherMock) GetTracerCollection() *tracercollection.TracerCollection

func (ContainerWatcherMock) OnCollectionReady added in v0.3.336

func (c ContainerWatcherMock) OnCollectionReady(_ func(), _ time.Duration) <-chan struct{}

func (ContainerWatcherMock) Ready

func (c ContainerWatcherMock) Ready() bool

func (ContainerWatcherMock) RegisterContainerReceiver added in v0.2.145

func (c ContainerWatcherMock) RegisterContainerReceiver(_ ContainerReceiver)

func (ContainerWatcherMock) RegisterCustomTracer added in v0.2.145

func (c ContainerWatcherMock) RegisterCustomTracer(_ TracerInterface) error

func (ContainerWatcherMock) Start

func (ContainerWatcherMock) Stop

func (c ContainerWatcherMock) Stop()

func (ContainerWatcherMock) UnregisterContainerReceiver added in v0.2.145

func (c ContainerWatcherMock) UnregisterContainerReceiver(_ ContainerReceiver)

func (ContainerWatcherMock) UnregisterCustomTracer added in v0.2.145

func (c ContainerWatcherMock) UnregisterCustomTracer(_ TracerInterface) error

type CustomTracerInitializer added in v0.3.3

type CustomTracerInitializer interface {
	NewTracer(
		kubeManager operators.DataOperator,
		runtime runtime.Runtime,
		ociStore *orasoci.ReadOnlyStore,
		eventCallback ResultCallback,
		thirdPartyEnricher TaskBasedEnricher,
	) (TracerInterface, error)
}

type CustomTracerMock added in v0.2.145

type CustomTracerMock struct{}

func (CustomTracerMock) Name added in v0.2.145

func (c CustomTracerMock) Name() string

func (CustomTracerMock) Start added in v0.2.145

func (c CustomTracerMock) Start() error

func (CustomTracerMock) Stop added in v0.2.145

func (c CustomTracerMock) Stop() error

type EnrichedEventReceiver added in v0.2.354

type EnrichedEventReceiver interface {
	ReportEnrichedEvent(enrichedEvent *events.EnrichedEvent)
}

type EventReceiver added in v0.2.145

type EventReceiver interface {
	ReportEvent(eventType utils.EventType, event utils.K8sEvent)
}

type GenericEventReceiver added in v0.3.3

type GenericEventReceiver any

type ResultCallback added in v0.2.278

type ResultCallback func(utils.K8sEvent, string, uint32)

type TaskBasedEnricher added in v0.2.278

type TaskBasedEnricher interface {
	SubmitEnrichmentTask(event utils.EnrichEvent, syscalls []uint64, callback ResultCallback, containerID string, processID uint32)
}

type ThirdPartyTracers added in v0.3.3

type ThirdPartyTracers struct {
	ThirdPartyTracersInitializers mapset.Set[CustomTracerInitializer]
	ThirdPartyEventReceivers      *maps.SafeMap[utils.EventType, mapset.Set[GenericEventReceiver]] // TODO: either EventReceiver or EnrichedEventReceiver
}

type TracerFactoryInterface added in v0.2.354

type TracerFactoryInterface interface {
	CreateAllTracers(manager TracerRegistrer)
}

type TracerInterface added in v0.2.354

type TracerInterface interface {
	// Start initializes and starts the tracer
	Start(ctx context.Context) error

	// Stop gracefully stops the tracer
	Stop() error

	// GetName returns the unique name of the tracer
	GetName() string

	// GetEventType returns the event type this tracer produces
	GetEventType() utils.EventType

	// IsEnabled checks if this tracer should be enabled based on configuration
	IsEnabled(cfg config.Config) bool
}

TracerInterface defines the common interface for all eBPF tracers

type TracerRegistrer added in v0.2.354

type TracerRegistrer interface {
	RegisterTracer(tracer TracerInterface)
}

Directories

Path Synopsis
v2

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL