From 3121ccc2dc600168cfc558fd1364864e1e881ad0 Mon Sep 17 00:00:00 2001 From: Heba Elayoty Date: Mon, 14 Nov 2022 10:06:21 -0800 Subject: [PATCH] Add GetPod func --- manager/resource.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/manager/resource.go b/manager/resource.go index a3883a6..0e25fcc 100644 --- a/manager/resource.go +++ b/manager/resource.go @@ -50,6 +50,11 @@ func NewResourceManager(podLister corev1listers.PodLister, return &rm, nil } +// GetPod retrieves the specified pod from Kubernetes. +func (rm *ResourceManager) GetPod(name, namespace string) (*v1.Pod, error) { + return rm.podLister.Pods(namespace).Get(name) +} + // GetPods returns a list of all known pods assigned to this virtual node. func (rm *ResourceManager) GetPods() []*v1.Pod { l, err := rm.podLister.List(labels.Everything())