watcher

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: Apache-2.0 Imports: 19 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeK8sWatcher

type FakeK8sWatcher struct {
	// contains filtered or unexported fields
}

FakeK8sWatcher is used as an "empty" K8sResourceWatcher when --enable-k8s-api flag is not set.

func NewFakeK8sWatcher

func NewFakeK8sWatcher(pods []interface{}) *FakeK8sWatcher

NewK8sWatcher returns a pointer to an initialized FakeK8sWatcher struct.

func (*FakeK8sWatcher) FindPod

func (watcher *FakeK8sWatcher) FindPod(containerID string) (*corev1.Pod, *corev1.ContainerStatus, bool)

FindPod implements K8sResourceWatcher.FindPod.

func (*FakeK8sWatcher) GetPodInfo

func (watcher *FakeK8sWatcher) GetPodInfo(containerID string, binary string, args string, nspid uint32) (*tetragon.Pod, *hubblev1.Endpoint)

type K8sResourceWatcher

type K8sResourceWatcher interface {
	// Find a pod/container pair for the given container ID.
	FindPod(containerID string) (*corev1.Pod, *corev1.ContainerStatus, bool)

	// Get PodInfo and Endpoint ID for a containerId.
	GetPodInfo(containerID, binary, args string, nspid uint32) (*tetragon.Pod, *hubblev1.Endpoint)
}

K8sResourceWatcher defines an interface for accessing various resources from Kubernetes API.

type K8sWatcher

type K8sWatcher struct {
	// contains filtered or unexported fields
}

K8sWatcher maintains a local cache of k8s resources.

func NewK8sWatcher

func NewK8sWatcher(k8sClient *kubernetes.Clientset, stateSyncIntervalSec time.Duration) *K8sWatcher

NewK8sWatcher returns a pointer to an initialized K8sWatcher struct.

func (*K8sWatcher) FindPod

func (watcher *K8sWatcher) FindPod(containerID string) (*corev1.Pod, *corev1.ContainerStatus, bool)

FindPod implements K8sResourceWatcher.FindPod.

func (*K8sWatcher) GetPodInfo

func (watcher *K8sWatcher) GetPodInfo(containerID string, binary string, args string, nspid uint32) (*tetragon.Pod, *hubblev1.Endpoint)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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