Skip to content

Commit ff68a9b

Browse files
Merge pull request #54257 from tiran/lister-getbykey
Automatic merge from submit-queue (batch tested with PRs 53194, 54257, 53014). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Use GetByKey() in typeLister_NonNamespacedGet The Get() function of non-namespace lister passes a temporary object to indexer.Get() in order to fetch the actual object from the indexer. This may cause Go to allocate the temporary object on the heap instead of the stack, as it is passed into interfaces. For non-namespaced objects, Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent to GetByKey(name). This could be the root cause of excessive allocations, e.g. in tests clusterRoleLister.Get() has trigger 4 billion allocations. See openshift/origin#16954 Kubernetes-commit: 4282ab39fc15d8267ceac36398947465867027db
2 parents c612149 + 825b15c commit ff68a9b

File tree

2 files changed

+261
-262
lines changed

2 files changed

+261
-262
lines changed

0 commit comments

Comments
 (0)