Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Add GetPod func
Browse files Browse the repository at this point in the history
  • Loading branch information
helayoty committed Nov 14, 2022
1 parent 9ec37a4 commit 3121ccc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions manager/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 3121ccc

Please sign in to comment.