forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
conversion.go
35 lines (29 loc) · 1.06 KB
/
conversion.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
package v1
import (
"k8s.io/kubernetes/pkg/runtime"
oapi "github.com/openshift/origin/pkg/api"
"github.com/openshift/origin/pkg/oauth/api"
)
func addConversionFuncs(scheme *runtime.Scheme) error {
if err := scheme.AddFieldLabelConversionFunc("v1", "OAuthAccessToken",
oapi.GetFieldLabelConversionFunc(api.OAuthAccessTokenToSelectableFields(&api.OAuthAccessToken{}), nil),
); err != nil {
return err
}
if err := scheme.AddFieldLabelConversionFunc("v1", "OAuthAuthorizeToken",
oapi.GetFieldLabelConversionFunc(api.OAuthAuthorizeTokenToSelectableFields(&api.OAuthAuthorizeToken{}), nil),
); err != nil {
return err
}
if err := scheme.AddFieldLabelConversionFunc("v1", "OAuthClient",
oapi.GetFieldLabelConversionFunc(api.OAuthClientToSelectableFields(&api.OAuthClient{}), nil),
); err != nil {
return err
}
if err := scheme.AddFieldLabelConversionFunc("v1", "OAuthClientAuthorization",
oapi.GetFieldLabelConversionFunc(api.OAuthClientAuthorizationToSelectableFields(&api.OAuthClientAuthorization{}), nil),
); err != nil {
return err
}
return nil
}