forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.go
26 lines (23 loc) · 1010 Bytes
/
install.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
package install
import (
"k8s.io/apimachinery/pkg/apimachinery/announced"
"k8s.io/apimachinery/pkg/apimachinery/registered"
"k8s.io/apimachinery/pkg/runtime"
configapi "github.com/openshift/origin/pkg/template/servicebroker/apis/config"
configapiv1 "github.com/openshift/origin/pkg/template/servicebroker/apis/config/v1"
)
// Install registers the API group and adds types to a scheme
func Install(groupFactoryRegistry announced.APIGroupFactoryRegistry, registry *registered.APIRegistrationManager, scheme *runtime.Scheme) {
if err := announced.NewGroupMetaFactory(
&announced.GroupMetaFactoryArgs{
GroupName: configapi.GroupName,
VersionPreferenceOrder: []string{configapiv1.SchemeGroupVersion.Version},
AddInternalObjectsToScheme: configapi.AddToScheme,
},
announced.VersionToSchemeFunc{
configapiv1.SchemeGroupVersion.Version: configapiv1.AddToScheme,
},
).Announce(groupFactoryRegistry).RegisterAndEnable(registry, scheme); err != nil {
panic(err)
}
}