-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Expand file tree
/
Copy pathconversion.go
More file actions
28 lines (23 loc) · 796 Bytes
/
conversion.go
File metadata and controls
28 lines (23 loc) · 796 Bytes
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
package v1
import (
"k8s.io/kubernetes/pkg/runtime"
oapi "github.com/openshift/origin/pkg/api"
"github.com/openshift/origin/pkg/sdn/api"
)
func addConversionFuncs(scheme *runtime.Scheme) {
if err := scheme.AddFieldLabelConversionFunc("v1", "ClusterNetwork",
oapi.GetFieldLabelConversionFunc(api.ClusterNetworkToSelectableFields(&api.ClusterNetwork{}), nil),
); err != nil {
panic(err)
}
if err := scheme.AddFieldLabelConversionFunc("v1", "HostSubnet",
oapi.GetFieldLabelConversionFunc(api.HostSubnetToSelectableFields(&api.HostSubnet{}), nil),
); err != nil {
panic(err)
}
if err := scheme.AddFieldLabelConversionFunc("v1", "NetNamespace",
oapi.GetFieldLabelConversionFunc(api.NetNamespaceToSelectableFields(&api.NetNamespace{}), nil),
); err != nil {
panic(err)
}
}