1
0
mirror of https://github.com/rancher/types.git synced 2025-08-31 12:48:45 +00:00

Regenerate for proper keying in Lister

This commit is contained in:
Craig Jellick
2017-12-11 20:30:50 -07:00
committed by Darren Shepherd
parent 33f2e1ebdb
commit 007b83c082
31 changed files with 211 additions and 31 deletions

View File

@@ -74,7 +74,13 @@ func (l *catalogLister) List(namespace string, selector labels.Selector) (ret []
}
func (l *catalogLister) Get(namespace, name string) (*Catalog, error) {
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(namespace + "/" + name)
var key string
if namespace != "" {
key = namespace + "/" + name
} else {
key = name
}
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
if err != nil {
return nil, err
}

View File

@@ -74,7 +74,13 @@ func (l *clusterLister) List(namespace string, selector labels.Selector) (ret []
}
func (l *clusterLister) Get(namespace, name string) (*Cluster, error) {
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(namespace + "/" + name)
var key string
if namespace != "" {
key = namespace + "/" + name
} else {
key = name
}
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
if err != nil {
return nil, err
}

View File

@@ -74,7 +74,13 @@ func (l *clusterEventLister) List(namespace string, selector labels.Selector) (r
}
func (l *clusterEventLister) Get(namespace, name string) (*ClusterEvent, error) {
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(namespace + "/" + name)
var key string
if namespace != "" {
key = namespace + "/" + name
} else {
key = name
}
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
if err != nil {
return nil, err
}

View File

@@ -74,7 +74,13 @@ func (l *clusterRoleTemplateBindingLister) List(namespace string, selector label
}
func (l *clusterRoleTemplateBindingLister) Get(namespace, name string) (*ClusterRoleTemplateBinding, error) {
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(namespace + "/" + name)
var key string
if namespace != "" {
key = namespace + "/" + name
} else {
key = name
}
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
if err != nil {
return nil, err
}

View File

@@ -74,7 +74,13 @@ func (l *dynamicSchemaLister) List(namespace string, selector labels.Selector) (
}
func (l *dynamicSchemaLister) Get(namespace, name string) (*DynamicSchema, error) {
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(namespace + "/" + name)
var key string
if namespace != "" {
key = namespace + "/" + name
} else {
key = name
}
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
if err != nil {
return nil, err
}

View File

@@ -74,7 +74,13 @@ func (l *groupLister) List(namespace string, selector labels.Selector) (ret []*G
}
func (l *groupLister) Get(namespace, name string) (*Group, error) {
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(namespace + "/" + name)
var key string
if namespace != "" {
key = namespace + "/" + name
} else {
key = name
}
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
if err != nil {
return nil, err
}

View File

@@ -74,7 +74,13 @@ func (l *groupMemberLister) List(namespace string, selector labels.Selector) (re
}
func (l *groupMemberLister) Get(namespace, name string) (*GroupMember, error) {
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(namespace + "/" + name)
var key string
if namespace != "" {
key = namespace + "/" + name
} else {
key = name
}
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
if err != nil {
return nil, err
}

View File

@@ -74,7 +74,13 @@ func (l *identityLister) List(namespace string, selector labels.Selector) (ret [
}
func (l *identityLister) Get(namespace, name string) (*Identity, error) {
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(namespace + "/" + name)
var key string
if namespace != "" {
key = namespace + "/" + name
} else {
key = name
}
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
if err != nil {
return nil, err
}

View File

@@ -74,7 +74,13 @@ func (l *machineLister) List(namespace string, selector labels.Selector) (ret []
}
func (l *machineLister) Get(namespace, name string) (*Machine, error) {
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(namespace + "/" + name)
var key string
if namespace != "" {
key = namespace + "/" + name
} else {
key = name
}
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
if err != nil {
return nil, err
}

View File

@@ -74,7 +74,13 @@ func (l *machineDriverLister) List(namespace string, selector labels.Selector) (
}
func (l *machineDriverLister) Get(namespace, name string) (*MachineDriver, error) {
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(namespace + "/" + name)
var key string
if namespace != "" {
key = namespace + "/" + name
} else {
key = name
}
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
if err != nil {
return nil, err
}

View File

@@ -74,7 +74,13 @@ func (l *machineTemplateLister) List(namespace string, selector labels.Selector)
}
func (l *machineTemplateLister) Get(namespace, name string) (*MachineTemplate, error) {
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(namespace + "/" + name)
var key string
if namespace != "" {
key = namespace + "/" + name
} else {
key = name
}
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
if err != nil {
return nil, err
}

View File

@@ -74,7 +74,13 @@ func (l *podSecurityPolicyTemplateLister) List(namespace string, selector labels
}
func (l *podSecurityPolicyTemplateLister) Get(namespace, name string) (*PodSecurityPolicyTemplate, error) {
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(namespace + "/" + name)
var key string
if namespace != "" {
key = namespace + "/" + name
} else {
key = name
}
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
if err != nil {
return nil, err
}

View File

@@ -74,7 +74,13 @@ func (l *projectLister) List(namespace string, selector labels.Selector) (ret []
}
func (l *projectLister) Get(namespace, name string) (*Project, error) {
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(namespace + "/" + name)
var key string
if namespace != "" {
key = namespace + "/" + name
} else {
key = name
}
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
if err != nil {
return nil, err
}

View File

@@ -74,7 +74,13 @@ func (l *projectRoleTemplateBindingLister) List(namespace string, selector label
}
func (l *projectRoleTemplateBindingLister) Get(namespace, name string) (*ProjectRoleTemplateBinding, error) {
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(namespace + "/" + name)
var key string
if namespace != "" {
key = namespace + "/" + name
} else {
key = name
}
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
if err != nil {
return nil, err
}

View File

@@ -74,7 +74,13 @@ func (l *roleTemplateLister) List(namespace string, selector labels.Selector) (r
}
func (l *roleTemplateLister) Get(namespace, name string) (*RoleTemplate, error) {
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(namespace + "/" + name)
var key string
if namespace != "" {
key = namespace + "/" + name
} else {
key = name
}
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
if err != nil {
return nil, err
}

View File

@@ -74,7 +74,13 @@ func (l *templateLister) List(namespace string, selector labels.Selector) (ret [
}
func (l *templateLister) Get(namespace, name string) (*Template, error) {
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(namespace + "/" + name)
var key string
if namespace != "" {
key = namespace + "/" + name
} else {
key = name
}
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
if err != nil {
return nil, err
}

View File

@@ -74,7 +74,13 @@ func (l *templateVersionLister) List(namespace string, selector labels.Selector)
}
func (l *templateVersionLister) Get(namespace, name string) (*TemplateVersion, error) {
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(namespace + "/" + name)
var key string
if namespace != "" {
key = namespace + "/" + name
} else {
key = name
}
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
if err != nil {
return nil, err
}

View File

@@ -74,7 +74,13 @@ func (l *tokenLister) List(namespace string, selector labels.Selector) (ret []*T
}
func (l *tokenLister) Get(namespace, name string) (*Token, error) {
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(namespace + "/" + name)
var key string
if namespace != "" {
key = namespace + "/" + name
} else {
key = name
}
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
if err != nil {
return nil, err
}

View File

@@ -74,7 +74,13 @@ func (l *userLister) List(namespace string, selector labels.Selector) (ret []*Us
}
func (l *userLister) Get(namespace, name string) (*User, error) {
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(namespace + "/" + name)
var key string
if namespace != "" {
key = namespace + "/" + name
} else {
key = name
}
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
if err != nil {
return nil, err
}