manager

package
v0.0.0-...-c4ea4c1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResourceManager

type ResourceManager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

ResourceManager works a cache for pods assigned to this virtual node within Kubernetes. New ResourceManagers should be created with the NewResourceManager() function.

func NewResourceManager

func NewResourceManager(k8sClient *kubernetes.Clientset) *ResourceManager

NewResourceManager returns a ResourceManager with the internal maps initialized.

func (*ResourceManager) AddPod

func (rm *ResourceManager) AddPod(p *v1.Pod)

AddPod adds a pod to the internal cache.

func (*ResourceManager) DeletePod

func (rm *ResourceManager) DeletePod(p *v1.Pod)

DeletePod removes the pod from the cache.

func (*ResourceManager) GetConfigMap

func (rm *ResourceManager) GetConfigMap(name, namespace string) (*v1.ConfigMap, error)

GetConfigMap returns the specified ConfigMap from Kubernetes. It retrieves it from cache if there

func (*ResourceManager) GetPod

func (rm *ResourceManager) GetPod(name string) *v1.Pod

GetPod retrieves the specified pod from the cache. It returns nil if a pod is not found.

func (*ResourceManager) GetPods

func (rm *ResourceManager) GetPods() []*v1.Pod

GetPods returns a list of all known pods assigned to this virtual node.

func (*ResourceManager) GetSecret

func (rm *ResourceManager) GetSecret(name, namespace string) (*v1.Secret, error)

GetSecret returns the specified ConfigMap from Kubernetes. It retrieves it from cache if there

func (*ResourceManager) SetPods

func (rm *ResourceManager) SetPods(pods *v1.PodList)

SetPods clears the internal cache and populates it with the supplied pods.

func (*ResourceManager) UpdatePod

func (rm *ResourceManager) UpdatePod(p *v1.Pod)

UpdatePod updates the supplied pod in the cache.

Jump to

Keyboard shortcuts

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