common

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIPForVersion added in v0.34.0

func GetIPForVersion(data datasource.Data, version, ipAddr datasource.FieldAccessor) (string, error)

Types

type K8sInventoryCache

type K8sInventoryCache interface {
	Start()
	Stop()

	GetPods() []*SlimPod
	GetPodByName(namespace string, name string) *SlimPod
	GetPodByIp(ip string) *SlimPod

	GetSvcs() []*SlimService
	GetSvcByName(namespace string, name string) *SlimService
	GetSvcByIp(ip string) *SlimService
}

K8sInventoryCache is a cache of Kubernetes resources such as pods and services that can be used by operators to enrich events.

func GetK8sInventoryCache

func GetK8sInventoryCache() (K8sInventoryCache, error)

type SlimObjectMeta added in v0.33.0

type SlimObjectMeta struct {
	Name            string                  `json:"name"`
	Namespace       string                  `json:"namespace"`
	ResourceVersion string                  `json:"resourceVersion"`
	Labels          map[string]string       `json:"labels"`
	OwnerReferences []metav1.OwnerReference `json:"ownerReferences"`
}

type SlimPod added in v0.33.0

type SlimPod struct {
	metav1.TypeMeta `json:",inline"`
	SlimObjectMeta  `json:",inline"`
	Spec            SlimPodSpec   `json:"spec"`
	Status          SlimPodStatus `json:"status"`
}

SlimPod is a reduced version of v1.Pod, it only contains the fields that are needed to enrich events.

func NewSlimPod added in v0.33.0

func NewSlimPod(p *v1.Pod) *SlimPod

type SlimPodSpec added in v0.33.0

type SlimPodSpec struct {
	HostNetwork bool   `json:"hostNetwork"`
	NodeName    string `json:"nodeName"`
}

type SlimPodStatus added in v0.33.0

type SlimPodStatus struct {
	HostIP string `json:"hostIP"`
	PodIP  string `json:"podIP"`
}

type SlimService added in v0.33.0

type SlimService struct {
	metav1.TypeMeta `json:",inline"`
	SlimObjectMeta  `json:",inline"`
	Spec            SlimServiceSpec `json:"spec"`
}

SlimService is a reduced version of v1.Service, it only contains the fields that are needed to enrich events.

func NewSlimService added in v0.33.0

func NewSlimService(s *v1.Service) *SlimService

type SlimServiceSpec added in v0.33.0

type SlimServiceSpec struct {
	ClusterIP string `json:"clusterIP"`
}

Jump to

Keyboard shortcuts

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