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

Commit

Permalink
Merge pull request #49 from helayoty/get-pod
Browse files Browse the repository at this point in the history
fear: Add GetPod func
  • Loading branch information
cpuguy83 authored Nov 14, 2022
2 parents 9ec37a4 + 3121ccc commit 85167f7
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 85167f7

Please sign in to comment.