forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fields.go
65 lines (57 loc) · 2.6 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package api
import "k8s.io/kubernetes/pkg/fields"
// ClusterPolicyToSelectableFields returns a label set that represents the object
// changes to the returned keys require registering conversions for existing versions using Scheme.AddFieldLabelConversionFunc
func ClusterPolicyToSelectableFields(policy *ClusterPolicy) fields.Set {
return fields.Set{
"metadata.name": policy.Name,
}
}
// ClusterPolicyBindingToSelectableFields returns a label set that represents the object
// changes to the returned keys require registering conversions for existing versions using Scheme.AddFieldLabelConversionFunc
func ClusterPolicyBindingToSelectableFields(policyBinding *ClusterPolicyBinding) fields.Set {
return fields.Set{
"metadata.name": policyBinding.Name,
}
}
// PolicyToSelectableFields returns a label set that represents the object
// changes to the returned keys require registering conversions for existing versions using Scheme.AddFieldLabelConversionFunc
func PolicyToSelectableFields(policy *Policy) fields.Set {
return fields.Set{
"metadata.name": policy.Name,
"metadata.namespace": policy.Namespace,
}
}
// PolicyBindingToSelectableFields returns a label set that represents the object
// changes to the returned keys require registering conversions for existing versions using Scheme.AddFieldLabelConversionFunc
func PolicyBindingToSelectableFields(policyBinding *PolicyBinding) fields.Set {
return fields.Set{
"metadata.name": policyBinding.Name,
"metadata.namespace": policyBinding.Namespace,
"policyRef.namespace": policyBinding.PolicyRef.Namespace,
}
}
// RoleToSelectableFields returns a label set that represents the object
// changes to the returned keys require registering conversions for existing versions using Scheme.AddFieldLabelConversionFunc
func RoleToSelectableFields(role *Role) fields.Set {
return fields.Set{
"metadata.name": role.Name,
"metadata.namespace": role.Namespace,
}
}
// RoleBindingToSelectableFields returns a label set that represents the object
// changes to the returned keys require registering conversions for existing versions using Scheme.AddFieldLabelConversionFunc
func RoleBindingToSelectableFields(roleBinding *RoleBinding) fields.Set {
return fields.Set{
"metadata.name": roleBinding.Name,
"metadata.namespace": roleBinding.Namespace,
}
}
// RoleBindingRestrictionToSelectableFields returns a label set that be used to
// identify a RoleBindingRestriction object.
func RoleBindingRestrictionToSelectableFields(rbr *RoleBindingRestriction) fields.Set {
return fields.Set{
"metadata.name": rbr.Name,
"metadata.namespace": rbr.Namespace,
}
}