forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fields.go
31 lines (27 loc) · 1.16 KB
/
fields.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package api
import "k8s.io/kubernetes/pkg/fields"
// GroupToSelectableFields returns a label set that represents the object
// changes to the returned keys require registering conversions for existing versions using Scheme.AddFieldLabelConversionFunc
func GroupToSelectableFields(group *Group) fields.Set {
return fields.Set{
"metadata.name": group.Name,
}
}
// IdentityToSelectableFields returns a label set that represents the object
// changes to the returned keys require registering conversions for existing versions using Scheme.AddFieldLabelConversionFunc
func IdentityToSelectableFields(identity *Identity) fields.Set {
return fields.Set{
"metadata.name": identity.Name,
"providerName": identity.ProviderName,
"providerUserName": identity.ProviderName,
"user.name": identity.User.Name,
"user.uid": string(identity.User.UID),
}
}
// UserToSelectableFields returns a label set that represents the object
// changes to the returned keys require registering conversions for existing versions using Scheme.AddFieldLabelConversionFunc
func UserToSelectableFields(user *User) fields.Set {
return fields.Set{
"metadata.name": user.Name,
}
}