Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UPSTREAM: 54257: Use GetByKey() in typeLister_NonNamespacedGet #16986

Merged
merged 2 commits into from
Oct 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package internalversion
import (
authorization "github.com/openshift/origin/pkg/authorization/apis/authorization"
"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 @@ -39,8 +38,7 @@ func (s *clusterPolicyLister) List(selector labels.Selector) (ret []*authorizati

// Get retrieves the ClusterPolicy from the index for a given name.
func (s *clusterPolicyLister) Get(name string) (*authorization.ClusterPolicy, error) {
key := &authorization.ClusterPolicy{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 @@ -5,7 +5,6 @@ package internalversion
import (
authorization "github.com/openshift/origin/pkg/authorization/apis/authorization"
"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 @@ -39,8 +38,7 @@ func (s *clusterPolicyBindingLister) List(selector labels.Selector) (ret []*auth

// Get retrieves the ClusterPolicyBinding from the index for a given name.
func (s *clusterPolicyBindingLister) Get(name string) (*authorization.ClusterPolicyBinding, error) {
key := &authorization.ClusterPolicyBinding{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 @@ -5,7 +5,6 @@ package internalversion
import (
authorization "github.com/openshift/origin/pkg/authorization/apis/authorization"
"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 @@ -39,8 +38,7 @@ func (s *clusterRoleLister) List(selector labels.Selector) (ret []*authorization

// Get retrieves the ClusterRole from the index for a given name.
func (s *clusterRoleLister) Get(name string) (*authorization.ClusterRole, error) {
key := &authorization.ClusterRole{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 @@ -5,7 +5,6 @@ package internalversion
import (
authorization "github.com/openshift/origin/pkg/authorization/apis/authorization"
"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 @@ -39,8 +38,7 @@ func (s *clusterRoleBindingLister) List(selector labels.Selector) (ret []*author

// Get retrieves the ClusterRoleBinding from the index for a given name.
func (s *clusterRoleBindingLister) Get(name string) (*authorization.ClusterRoleBinding, error) {
key := &authorization.ClusterRoleBinding{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 @@ -5,7 +5,6 @@ package v1
import (
v1 "github.com/openshift/origin/pkg/authorization/apis/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 @@ -39,8 +38,7 @@ func (s *clusterPolicyLister) List(selector labels.Selector) (ret []*v1.ClusterP

// Get retrieves the ClusterPolicy from the index for a given name.
func (s *clusterPolicyLister) Get(name string) (*v1.ClusterPolicy, error) {
key := &v1.ClusterPolicy{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
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package v1
import (
v1 "github.com/openshift/origin/pkg/authorization/apis/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 @@ -39,8 +38,7 @@ func (s *clusterPolicyBindingLister) List(selector labels.Selector) (ret []*v1.C

// Get retrieves the ClusterPolicyBinding from the index for a given name.
func (s *clusterPolicyBindingLister) Get(name string) (*v1.ClusterPolicyBinding, error) {
key := &v1.ClusterPolicyBinding{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
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package v1
import (
v1 "github.com/openshift/origin/pkg/authorization/apis/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 @@ -39,8 +38,7 @@ func (s *clusterRoleLister) List(selector labels.Selector) (ret []*v1.ClusterRol

// Get retrieves the ClusterRole from the index for a given name.
func (s *clusterRoleLister) Get(name string) (*v1.ClusterRole, error) {
key := &v1.ClusterRole{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
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package v1
import (
v1 "github.com/openshift/origin/pkg/authorization/apis/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 @@ -39,8 +38,7 @@ func (s *clusterRoleBindingLister) List(selector labels.Selector) (ret []*v1.Clu

// Get retrieves the ClusterRoleBinding from the index for a given name.
func (s *clusterRoleBindingLister) Get(name string) (*v1.ClusterRoleBinding, error) {
key := &v1.ClusterRoleBinding{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 pkg/image/generated/listers/image/internalversion/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package internalversion
import (
image "github.com/openshift/origin/pkg/image/apis/image"
"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 @@ -39,8 +38,7 @@ func (s *imageLister) List(selector labels.Selector) (ret []*image.Image, err er

// Get retrieves the Image from the index for a given name.
func (s *imageLister) Get(name string) (*image.Image, error) {
key := &image.Image{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 pkg/image/generated/listers/image/v1/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package v1
import (
v1 "github.com/openshift/origin/pkg/image/apis/image/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 @@ -39,8 +38,7 @@ func (s *imageLister) List(selector labels.Selector) (ret []*v1.Image, err error

// Get retrieves the Image from the index for a given name.
func (s *imageLister) Get(name string) (*v1.Image, error) {
key := &v1.Image{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
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package internalversion
import (
network "github.com/openshift/origin/pkg/network/apis/network"
"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 @@ -39,8 +38,7 @@ func (s *clusterNetworkLister) List(selector labels.Selector) (ret []*network.Cl

// Get retrieves the ClusterNetwork from the index for a given name.
func (s *clusterNetworkLister) Get(name string) (*network.ClusterNetwork, error) {
key := &network.ClusterNetwork{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 @@ -5,7 +5,6 @@ package internalversion
import (
network "github.com/openshift/origin/pkg/network/apis/network"
"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 @@ -39,8 +38,7 @@ func (s *hostSubnetLister) List(selector labels.Selector) (ret []*network.HostSu

// Get retrieves the HostSubnet from the index for a given name.
func (s *hostSubnetLister) Get(name string) (*network.HostSubnet, error) {
key := &network.HostSubnet{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 @@ -5,7 +5,6 @@ package internalversion
import (
network "github.com/openshift/origin/pkg/network/apis/network"
"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 @@ -39,8 +38,7 @@ func (s *netNamespaceLister) List(selector labels.Selector) (ret []*network.NetN

// Get retrieves the NetNamespace from the index for a given name.
func (s *netNamespaceLister) Get(name string) (*network.NetNamespace, error) {
key := &network.NetNamespace{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 pkg/network/generated/listers/network/v1/clusternetwork.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package v1
import (
v1 "github.com/openshift/origin/pkg/network/apis/network/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 @@ -39,8 +38,7 @@ func (s *clusterNetworkLister) List(selector labels.Selector) (ret []*v1.Cluster

// Get retrieves the ClusterNetwork from the index for a given name.
func (s *clusterNetworkLister) Get(name string) (*v1.ClusterNetwork, error) {
key := &v1.ClusterNetwork{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 pkg/network/generated/listers/network/v1/hostsubnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package v1
import (
v1 "github.com/openshift/origin/pkg/network/apis/network/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 @@ -39,8 +38,7 @@ func (s *hostSubnetLister) List(selector labels.Selector) (ret []*v1.HostSubnet,

// Get retrieves the HostSubnet from the index for a given name.
func (s *hostSubnetLister) Get(name string) (*v1.HostSubnet, error) {
key := &v1.HostSubnet{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 pkg/network/generated/listers/network/v1/netnamespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package v1
import (
v1 "github.com/openshift/origin/pkg/network/apis/network/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 @@ -39,8 +38,7 @@ func (s *netNamespaceLister) List(selector labels.Selector) (ret []*v1.NetNamesp

// Get retrieves the NetNamespace from the index for a given name.
func (s *netNamespaceLister) Get(name string) (*v1.NetNamespace, error) {
key := &v1.NetNamespace{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
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package internalversion
import (
oauth "github.com/openshift/origin/pkg/oauth/apis/oauth"
"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 @@ -39,8 +38,7 @@ func (s *oAuthAccessTokenLister) List(selector labels.Selector) (ret []*oauth.OA

// Get retrieves the OAuthAccessToken from the index for a given name.
func (s *oAuthAccessTokenLister) Get(name string) (*oauth.OAuthAccessToken, error) {
key := &oauth.OAuthAccessToken{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 @@ -5,7 +5,6 @@ package internalversion
import (
oauth "github.com/openshift/origin/pkg/oauth/apis/oauth"
"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 @@ -39,8 +38,7 @@ func (s *oAuthAuthorizeTokenLister) List(selector labels.Selector) (ret []*oauth

// Get retrieves the OAuthAuthorizeToken from the index for a given name.
func (s *oAuthAuthorizeTokenLister) Get(name string) (*oauth.OAuthAuthorizeToken, error) {
key := &oauth.OAuthAuthorizeToken{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 @@ -5,7 +5,6 @@ package internalversion
import (
oauth "github.com/openshift/origin/pkg/oauth/apis/oauth"
"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 @@ -39,8 +38,7 @@ func (s *oAuthClientLister) List(selector labels.Selector) (ret []*oauth.OAuthCl

// Get retrieves the OAuthClient from the index for a given name.
func (s *oAuthClientLister) Get(name string) (*oauth.OAuthClient, error) {
key := &oauth.OAuthClient{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 @@ -5,7 +5,6 @@ package internalversion
import (
oauth "github.com/openshift/origin/pkg/oauth/apis/oauth"
"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 @@ -39,8 +38,7 @@ func (s *oAuthClientAuthorizationLister) List(selector labels.Selector) (ret []*

// Get retrieves the OAuthClientAuthorization from the index for a given name.
func (s *oAuthClientAuthorizationLister) Get(name string) (*oauth.OAuthClientAuthorization, error) {
key := &oauth.OAuthClientAuthorization{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 pkg/oauth/generated/listers/oauth/v1/oauthaccesstoken.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package v1
import (
v1 "github.com/openshift/origin/pkg/oauth/apis/oauth/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 @@ -39,8 +38,7 @@ func (s *oAuthAccessTokenLister) List(selector labels.Selector) (ret []*v1.OAuth

// Get retrieves the OAuthAccessToken from the index for a given name.
func (s *oAuthAccessTokenLister) Get(name string) (*v1.OAuthAccessToken, error) {
key := &v1.OAuthAccessToken{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 pkg/oauth/generated/listers/oauth/v1/oauthauthorizetoken.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package v1
import (
v1 "github.com/openshift/origin/pkg/oauth/apis/oauth/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 @@ -39,8 +38,7 @@ func (s *oAuthAuthorizeTokenLister) List(selector labels.Selector) (ret []*v1.OA

// Get retrieves the OAuthAuthorizeToken from the index for a given name.
func (s *oAuthAuthorizeTokenLister) Get(name string) (*v1.OAuthAuthorizeToken, error) {
key := &v1.OAuthAuthorizeToken{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
Loading