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