Documentation ¶
Index ¶
- type ResourceManager
- func (rm *ResourceManager) AddPod(p *v1.Pod)
- func (rm *ResourceManager) DeletePod(p *v1.Pod)
- func (rm *ResourceManager) GetConfigMap(name, namespace string) (*v1.ConfigMap, error)
- func (rm *ResourceManager) GetPod(namespace, name string) *v1.Pod
- func (rm *ResourceManager) GetPods() []*v1.Pod
- func (rm *ResourceManager) GetSecret(name, namespace string) (*v1.Secret, error)
- func (rm *ResourceManager) SetPods(pods *v1.PodList)
- func (rm *ResourceManager) UpdatePod(p *v1.Pod)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResourceManager ¶
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.Interface) *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(namespace, 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.