pod

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NodeNameSpec = "nodeName"
)

Variables

This section is empty.

Functions

func NodeNameIndexer

func NodeNameIndexer() cache.Indexers

NodeNameIndexer returns indexer to index in the data store using node name

Types

type PodClientAPIWrapper added in v1.1.0

type PodClientAPIWrapper interface {
	GetPod(namespace string, name string) (*v1.Pod, error)
	ListPods(nodeName string) (*v1.PodList, error)
	AnnotatePod(podNamespace string, podName string, uid types.UID, key string, val string) error
	GetPodFromAPIServer(ctx context.Context, namespace string, name string) (*v1.Pod, error)
	GetRunningPodsOnNode(nodeName string) ([]v1.Pod, error)
}

func NewPodAPIWrapper added in v1.1.0

func NewPodAPIWrapper(dataStore cache.Indexer, client client.Client,
	coreV1 corev1.CoreV1Interface) PodClientAPIWrapper

type PodConverter

type PodConverter struct {
	K8sResource     string
	K8sResourceType runtime.Object
}

PodConverter implements the interface to convert k8s pod object to a stripped down version of pod to save on memory utilized

func (*PodConverter) ConvertList

func (c *PodConverter) ConvertList(originalList interface{}) (convertedList interface{}, err error)

ConcertList converts the original pod list to stripped down list of pod objects

func (*PodConverter) ConvertObject

func (c *PodConverter) ConvertObject(originalObj interface{}) (convertedObj interface{}, err error)

ConcertObject converts original pod object to stripped down pod object

func (*PodConverter) Indexer added in v1.1.0

func (c *PodConverter) Indexer(obj interface{}) (string, error)

NSKeyIndexer is the key function to index the pod object using namespace/name

func (*PodConverter) Resource

func (c *PodConverter) Resource() string

Resource to watch and list

func (*PodConverter) ResourceType

func (c *PodConverter) ResourceType() runtime.Object

ResourceType to watch and list

func (*PodConverter) StripDownPod

func (c *PodConverter) StripDownPod(pod *v1.Pod) *v1.Pod

StripDownPod removes all the extra details from pod that are not required by the controller.

Jump to

Keyboard shortcuts

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