Skip to content

Commit

Permalink
Merge pull request #54257 from tiran/lister-getbykey
Browse files Browse the repository at this point in the history
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
  • Loading branch information
k8s-publish-robot committed Oct 20, 2017
2 parents f80b026 + 5fa9712 commit 21595ad
Show file tree
Hide file tree
Showing 41 changed files with 27 additions and 95 deletions.
1 change: 0 additions & 1 deletion listers/admissionregistration/v1alpha1/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ go_library(
deps = [
"//vendor/k8s.io/api/admissionregistration/v1alpha1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
"//vendor/k8s.io/client-go/tools/cache:go_default_library",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package v1alpha1
import (
v1alpha1 "k8s.io/api/admissionregistration/v1alpha1"
"k8s.io/apimachinery/pkg/api/errors"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
Expand Down Expand Up @@ -55,8 +54,7 @@ func (s *externalAdmissionHookConfigurationLister) List(selector labels.Selector

// Get retrieves the ExternalAdmissionHookConfiguration from the index for a given name.
func (s *externalAdmissionHookConfigurationLister) Get(name string) (*v1alpha1.ExternalAdmissionHookConfiguration, error) {
key := &v1alpha1.ExternalAdmissionHookConfiguration{ObjectMeta: v1.ObjectMeta{Name: name}}
obj, exists, err := s.indexer.Get(key)
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package v1alpha1
import (
v1alpha1 "k8s.io/api/admissionregistration/v1alpha1"
"k8s.io/apimachinery/pkg/api/errors"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
Expand Down Expand Up @@ -55,8 +54,7 @@ func (s *initializerConfigurationLister) List(selector labels.Selector) (ret []*

// Get retrieves the InitializerConfiguration from the index for a given name.
func (s *initializerConfigurationLister) Get(name string) (*v1alpha1.InitializerConfiguration, error) {
key := &v1alpha1.InitializerConfiguration{ObjectMeta: v1.ObjectMeta{Name: name}}
obj, exists, err := s.indexer.Get(key)
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
Expand Down
1 change: 0 additions & 1 deletion listers/authentication/v1/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ go_library(
deps = [
"//vendor/k8s.io/api/authentication/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
"//vendor/k8s.io/client-go/tools/cache:go_default_library",
],
Expand Down
4 changes: 1 addition & 3 deletions listers/authentication/v1/tokenreview.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package v1
import (
v1 "k8s.io/api/authentication/v1"
"k8s.io/apimachinery/pkg/api/errors"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
Expand Down Expand Up @@ -55,8 +54,7 @@ func (s *tokenReviewLister) List(selector labels.Selector) (ret []*v1.TokenRevie

// Get retrieves the TokenReview from the index for a given name.
func (s *tokenReviewLister) Get(name string) (*v1.TokenReview, error) {
key := &v1.TokenReview{ObjectMeta: meta_v1.ObjectMeta{Name: name}}
obj, exists, err := s.indexer.Get(key)
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
Expand Down
1 change: 0 additions & 1 deletion listers/authentication/v1beta1/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ go_library(
deps = [
"//vendor/k8s.io/api/authentication/v1beta1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
"//vendor/k8s.io/client-go/tools/cache:go_default_library",
],
Expand Down
4 changes: 1 addition & 3 deletions listers/authentication/v1beta1/tokenreview.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package v1beta1
import (
v1beta1 "k8s.io/api/authentication/v1beta1"
"k8s.io/apimachinery/pkg/api/errors"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
Expand Down Expand Up @@ -55,8 +54,7 @@ func (s *tokenReviewLister) List(selector labels.Selector) (ret []*v1beta1.Token

// Get retrieves the TokenReview from the index for a given name.
func (s *tokenReviewLister) Get(name string) (*v1beta1.TokenReview, error) {
key := &v1beta1.TokenReview{ObjectMeta: v1.ObjectMeta{Name: name}}
obj, exists, err := s.indexer.Get(key)
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
Expand Down
1 change: 0 additions & 1 deletion listers/authorization/v1/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ go_library(
deps = [
"//vendor/k8s.io/api/authorization/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
"//vendor/k8s.io/client-go/tools/cache:go_default_library",
],
Expand Down
4 changes: 1 addition & 3 deletions listers/authorization/v1/selfsubjectaccessreview.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package v1
import (
v1 "k8s.io/api/authorization/v1"
"k8s.io/apimachinery/pkg/api/errors"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
Expand Down Expand Up @@ -55,8 +54,7 @@ func (s *selfSubjectAccessReviewLister) List(selector labels.Selector) (ret []*v

// Get retrieves the SelfSubjectAccessReview from the index for a given name.
func (s *selfSubjectAccessReviewLister) Get(name string) (*v1.SelfSubjectAccessReview, error) {
key := &v1.SelfSubjectAccessReview{ObjectMeta: meta_v1.ObjectMeta{Name: name}}
obj, exists, err := s.indexer.Get(key)
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
Expand Down
4 changes: 1 addition & 3 deletions listers/authorization/v1/selfsubjectrulesreview.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package v1
import (
v1 "k8s.io/api/authorization/v1"
"k8s.io/apimachinery/pkg/api/errors"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
Expand Down Expand Up @@ -55,8 +54,7 @@ func (s *selfSubjectRulesReviewLister) List(selector labels.Selector) (ret []*v1

// Get retrieves the SelfSubjectRulesReview from the index for a given name.
func (s *selfSubjectRulesReviewLister) Get(name string) (*v1.SelfSubjectRulesReview, error) {
key := &v1.SelfSubjectRulesReview{ObjectMeta: meta_v1.ObjectMeta{Name: name}}
obj, exists, err := s.indexer.Get(key)
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
Expand Down
4 changes: 1 addition & 3 deletions listers/authorization/v1/subjectaccessreview.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package v1
import (
v1 "k8s.io/api/authorization/v1"
"k8s.io/apimachinery/pkg/api/errors"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
Expand Down Expand Up @@ -55,8 +54,7 @@ func (s *subjectAccessReviewLister) List(selector labels.Selector) (ret []*v1.Su

// Get retrieves the SubjectAccessReview from the index for a given name.
func (s *subjectAccessReviewLister) Get(name string) (*v1.SubjectAccessReview, error) {
key := &v1.SubjectAccessReview{ObjectMeta: meta_v1.ObjectMeta{Name: name}}
obj, exists, err := s.indexer.Get(key)
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
Expand Down
1 change: 0 additions & 1 deletion listers/authorization/v1beta1/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ go_library(
deps = [
"//vendor/k8s.io/api/authorization/v1beta1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
"//vendor/k8s.io/client-go/tools/cache:go_default_library",
],
Expand Down
4 changes: 1 addition & 3 deletions listers/authorization/v1beta1/selfsubjectaccessreview.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package v1beta1
import (
v1beta1 "k8s.io/api/authorization/v1beta1"
"k8s.io/apimachinery/pkg/api/errors"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
Expand Down Expand Up @@ -55,8 +54,7 @@ func (s *selfSubjectAccessReviewLister) List(selector labels.Selector) (ret []*v

// Get retrieves the SelfSubjectAccessReview from the index for a given name.
func (s *selfSubjectAccessReviewLister) Get(name string) (*v1beta1.SelfSubjectAccessReview, error) {
key := &v1beta1.SelfSubjectAccessReview{ObjectMeta: v1.ObjectMeta{Name: name}}
obj, exists, err := s.indexer.Get(key)
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
Expand Down
4 changes: 1 addition & 3 deletions listers/authorization/v1beta1/selfsubjectrulesreview.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package v1beta1
import (
v1beta1 "k8s.io/api/authorization/v1beta1"
"k8s.io/apimachinery/pkg/api/errors"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
Expand Down Expand Up @@ -55,8 +54,7 @@ func (s *selfSubjectRulesReviewLister) List(selector labels.Selector) (ret []*v1

// Get retrieves the SelfSubjectRulesReview from the index for a given name.
func (s *selfSubjectRulesReviewLister) Get(name string) (*v1beta1.SelfSubjectRulesReview, error) {
key := &v1beta1.SelfSubjectRulesReview{ObjectMeta: v1.ObjectMeta{Name: name}}
obj, exists, err := s.indexer.Get(key)
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
Expand Down
4 changes: 1 addition & 3 deletions listers/authorization/v1beta1/subjectaccessreview.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package v1beta1
import (
v1beta1 "k8s.io/api/authorization/v1beta1"
"k8s.io/apimachinery/pkg/api/errors"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
Expand Down Expand Up @@ -55,8 +54,7 @@ func (s *subjectAccessReviewLister) List(selector labels.Selector) (ret []*v1bet

// Get retrieves the SubjectAccessReview from the index for a given name.
func (s *subjectAccessReviewLister) Get(name string) (*v1beta1.SubjectAccessReview, error) {
key := &v1beta1.SubjectAccessReview{ObjectMeta: v1.ObjectMeta{Name: name}}
obj, exists, err := s.indexer.Get(key)
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
Expand Down
1 change: 0 additions & 1 deletion listers/certificates/v1beta1/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ go_library(
deps = [
"//vendor/k8s.io/api/certificates/v1beta1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
"//vendor/k8s.io/client-go/tools/cache:go_default_library",
],
Expand Down
4 changes: 1 addition & 3 deletions listers/certificates/v1beta1/certificatesigningrequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package v1beta1
import (
v1beta1 "k8s.io/api/certificates/v1beta1"
"k8s.io/apimachinery/pkg/api/errors"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
Expand Down Expand Up @@ -55,8 +54,7 @@ func (s *certificateSigningRequestLister) List(selector labels.Selector) (ret []

// Get retrieves the CertificateSigningRequest from the index for a given name.
func (s *certificateSigningRequestLister) Get(name string) (*v1beta1.CertificateSigningRequest, error) {
key := &v1beta1.CertificateSigningRequest{ObjectMeta: v1.ObjectMeta{Name: name}}
obj, exists, err := s.indexer.Get(key)
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
Expand Down
1 change: 0 additions & 1 deletion listers/core/v1/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ go_library(
deps = [
"//vendor/k8s.io/api/core/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
"//vendor/k8s.io/client-go/tools/cache:go_default_library",
],
Expand Down
4 changes: 1 addition & 3 deletions listers/core/v1/componentstatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package v1
import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
Expand Down Expand Up @@ -55,8 +54,7 @@ func (s *componentStatusLister) List(selector labels.Selector) (ret []*v1.Compon

// Get retrieves the ComponentStatus from the index for a given name.
func (s *componentStatusLister) Get(name string) (*v1.ComponentStatus, error) {
key := &v1.ComponentStatus{ObjectMeta: meta_v1.ObjectMeta{Name: name}}
obj, exists, err := s.indexer.Get(key)
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
Expand Down
4 changes: 1 addition & 3 deletions listers/core/v1/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package v1
import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
Expand Down Expand Up @@ -55,8 +54,7 @@ func (s *namespaceLister) List(selector labels.Selector) (ret []*v1.Namespace, e

// Get retrieves the Namespace from the index for a given name.
func (s *namespaceLister) Get(name string) (*v1.Namespace, error) {
key := &v1.Namespace{ObjectMeta: meta_v1.ObjectMeta{Name: name}}
obj, exists, err := s.indexer.Get(key)
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
Expand Down
4 changes: 1 addition & 3 deletions listers/core/v1/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package v1
import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
Expand Down Expand Up @@ -55,8 +54,7 @@ func (s *nodeLister) List(selector labels.Selector) (ret []*v1.Node, err error)

// Get retrieves the Node from the index for a given name.
func (s *nodeLister) Get(name string) (*v1.Node, error) {
key := &v1.Node{ObjectMeta: meta_v1.ObjectMeta{Name: name}}
obj, exists, err := s.indexer.Get(key)
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
Expand Down
4 changes: 1 addition & 3 deletions listers/core/v1/persistentvolume.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package v1
import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
Expand Down Expand Up @@ -55,8 +54,7 @@ func (s *persistentVolumeLister) List(selector labels.Selector) (ret []*v1.Persi

// Get retrieves the PersistentVolume from the index for a given name.
func (s *persistentVolumeLister) Get(name string) (*v1.PersistentVolume, error) {
key := &v1.PersistentVolume{ObjectMeta: meta_v1.ObjectMeta{Name: name}}
obj, exists, err := s.indexer.Get(key)
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
Expand Down
4 changes: 1 addition & 3 deletions listers/extensions/v1beta1/podsecuritypolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package v1beta1
import (
v1beta1 "k8s.io/api/extensions/v1beta1"
"k8s.io/apimachinery/pkg/api/errors"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
Expand Down Expand Up @@ -55,8 +54,7 @@ func (s *podSecurityPolicyLister) List(selector labels.Selector) (ret []*v1beta1

// Get retrieves the PodSecurityPolicy from the index for a given name.
func (s *podSecurityPolicyLister) Get(name string) (*v1beta1.PodSecurityPolicy, error) {
key := &v1beta1.PodSecurityPolicy{ObjectMeta: v1.ObjectMeta{Name: name}}
obj, exists, err := s.indexer.Get(key)
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
Expand Down
4 changes: 1 addition & 3 deletions listers/extensions/v1beta1/thirdpartyresource.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package v1beta1
import (
v1beta1 "k8s.io/api/extensions/v1beta1"
"k8s.io/apimachinery/pkg/api/errors"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
Expand Down Expand Up @@ -55,8 +54,7 @@ func (s *thirdPartyResourceLister) List(selector labels.Selector) (ret []*v1beta

// Get retrieves the ThirdPartyResource from the index for a given name.
func (s *thirdPartyResourceLister) Get(name string) (*v1beta1.ThirdPartyResource, error) {
key := &v1beta1.ThirdPartyResource{ObjectMeta: v1.ObjectMeta{Name: name}}
obj, exists, err := s.indexer.Get(key)
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
Expand Down
1 change: 0 additions & 1 deletion listers/imagepolicy/v1alpha1/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ go_library(
deps = [
"//vendor/k8s.io/api/imagepolicy/v1alpha1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
"//vendor/k8s.io/client-go/tools/cache:go_default_library",
],
Expand Down
4 changes: 1 addition & 3 deletions listers/imagepolicy/v1alpha1/imagereview.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package v1alpha1
import (
v1alpha1 "k8s.io/api/imagepolicy/v1alpha1"
"k8s.io/apimachinery/pkg/api/errors"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
Expand Down Expand Up @@ -55,8 +54,7 @@ func (s *imageReviewLister) List(selector labels.Selector) (ret []*v1alpha1.Imag

// Get retrieves the ImageReview from the index for a given name.
func (s *imageReviewLister) Get(name string) (*v1alpha1.ImageReview, error) {
key := &v1alpha1.ImageReview{ObjectMeta: v1.ObjectMeta{Name: name}}
obj, exists, err := s.indexer.Get(key)
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
Expand Down
1 change: 0 additions & 1 deletion listers/rbac/v1/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ go_library(
deps = [
"//vendor/k8s.io/api/rbac/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
"//vendor/k8s.io/client-go/tools/cache:go_default_library",
],
Expand Down
Loading

0 comments on commit 21595ad

Please sign in to comment.