mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 22:20:51 +00:00
Changing the scheduler package to use *api.Pod instead of api.Pod to
avoid unnecessary shallow copies. The change rippled through a lot of code.
This commit is contained in:
6
pkg/client/cache/listers.go
vendored
6
pkg/client/cache/listers.go
vendored
@@ -42,11 +42,11 @@ type StoreToPodLister struct {
|
||||
// TODO Get rid of the selector because that is confusing because the user might not realize that there has already been
|
||||
// some selection at the caching stage. Also, consistency will facilitate code generation. However, the pkg/client
|
||||
// is inconsistent too.
|
||||
func (s *StoreToPodLister) List(selector labels.Selector) (pods []api.Pod, err error) {
|
||||
func (s *StoreToPodLister) List(selector labels.Selector) (pods []*api.Pod, err error) {
|
||||
for _, m := range s.Store.List() {
|
||||
pod := m.(*api.Pod)
|
||||
if selector.Matches(labels.Set(pod.Labels)) {
|
||||
pods = append(pods, *pod)
|
||||
pods = append(pods, pod)
|
||||
}
|
||||
}
|
||||
return pods, nil
|
||||
@@ -106,7 +106,7 @@ func (s *StoreToServiceLister) List() (services api.ServiceList, err error) {
|
||||
|
||||
// TODO: Move this back to scheduler as a helper function that takes a Store,
|
||||
// rather than a method of StoreToServiceLister.
|
||||
func (s *StoreToServiceLister) GetPodServices(pod api.Pod) (services []api.Service, err error) {
|
||||
func (s *StoreToServiceLister) GetPodServices(pod *api.Pod) (services []api.Service, err error) {
|
||||
var selector labels.Selector
|
||||
var service api.Service
|
||||
|
||||
|
Reference in New Issue
Block a user