func (s *clusterRoleLister) Get(name string) (*v1.ClusterRole, error) {
	obj, exists, err := s.indexer.GetByKey(name)
	if err != nil {
		return nil, err
	}
	if !exists {
		return nil, errors.NewNotFound(v1.Resource("clusterrole"), name)
	}
	return obj.(*v1.ClusterRole), nil
}
Get retrieves the ClusterRole from the index for a given name.
package v1
import (
	v1 "k8s.io/api/rbac/v1"
	"k8s.io/apimachinery/pkg/api/errors"
	"k8s.io/apimachinery/pkg/labels"
	"k8s.io/client-go/tools/cache"
)
type ClusterRoleLister interface {
	List(selector labels.Selector) (ret []*v1.ClusterRole, err error)
	Get(name string) (*v1.ClusterRole, error)
	ClusterRoleListerExpansion
}
type clusterRoleLister struct {
	indexer cache.Indexer
}
func NewClusterRoleLister(indexer cache.Indexer) ClusterRoleLister {
	return &clusterRoleLister{indexer: indexer}
}
func (s *clusterRoleLister) List(selector labels.Selector) (ret []*v1.ClusterRole, err error) {
	err = cache.ListAll(s.indexer, selector, func(m interface{}) {
		ret = append(ret, m.(*v1.ClusterRole))
	})
	return ret, err
}