Help us shape the future of Go! Take the 2026 Go Developer Survey

k8scache

package
v0.3.308 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type K8sObjectCacheImpl

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

func NewK8sObjectCache

func NewK8sObjectCache(nodeName string, k8sClient k8sclient.K8sClientInterface) (*K8sObjectCacheImpl, error)

func (*K8sObjectCacheImpl) AddHandler

func (k *K8sObjectCacheImpl) AddHandler(_ context.Context, obj runtime.Object)

AddHandler adds pod objects to both name and IP indexes, ignoring other resource types.

func (*K8sObjectCacheImpl) DeleteHandler

func (k *K8sObjectCacheImpl) DeleteHandler(_ context.Context, obj runtime.Object)

DeleteHandler removes the current pod and its IP mappings only when the deleted UID matches.

func (*K8sObjectCacheImpl) DeleteSharedContainerData added in v0.2.231

func (k *K8sObjectCacheImpl) DeleteSharedContainerData(containerID string)

func (*K8sObjectCacheImpl) GetApiServerIpAddress

func (k *K8sObjectCacheImpl) GetApiServerIpAddress() string

func (*K8sObjectCacheImpl) GetPod added in v0.2.231

func (k *K8sObjectCacheImpl) GetPod(namespace, podName string) *corev1.Pod

GetPod returns the pod for the given namespace and pod name, if not found returns nil

func (*K8sObjectCacheImpl) GetPodByIP added in v0.3.254

func (k *K8sObjectCacheImpl) GetPodByIP(ip string) *corev1.Pod

GetPodByIP returns a cached pod by its primary or secondary IP in constant time.

func (*K8sObjectCacheImpl) GetPodSpec

func (k *K8sObjectCacheImpl) GetPodSpec(namespace, podName string) *corev1.PodSpec

GetPodSpec returns the pod spec for the given namespace and pod name, if not found returns nil

func (*K8sObjectCacheImpl) GetPodStatus

func (k *K8sObjectCacheImpl) GetPodStatus(namespace, podName string) *corev1.PodStatus

GetPodStatus returns the pod status for the given namespace and pod name, if not found returns nil

func (*K8sObjectCacheImpl) GetPods

func (k *K8sObjectCacheImpl) GetPods() []*corev1.Pod

func (*K8sObjectCacheImpl) GetSharedContainerData added in v0.2.231

func (k *K8sObjectCacheImpl) GetSharedContainerData(containerID string) *objectcache.WatchedContainerData

func (*K8sObjectCacheImpl) ModifyHandler

func (k *K8sObjectCacheImpl) ModifyHandler(_ context.Context, obj runtime.Object)

ModifyHandler updates both pod indexes and removes stale IP mappings.

func (*K8sObjectCacheImpl) SetSharedContainerData added in v0.2.231

func (k *K8sObjectCacheImpl) SetSharedContainerData(containerID string, data *objectcache.WatchedContainerData)

func (*K8sObjectCacheImpl) WatchResources

func (k *K8sObjectCacheImpl) WatchResources() []watcher.WatchResource

Jump to

Keyboard shortcuts

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