separate announce factories

This commit is contained in:
deads2k
2017-01-20 16:28:48 -05:00
parent ee70adb9e7
commit 7cc9702402
18 changed files with 49 additions and 52 deletions

View File

@@ -30,11 +30,11 @@ import (
)
func init() {
Install(api.Registry, api.Scheme)
Install(api.GroupFactoryRegistry, api.Registry, api.Scheme)
}
// Install registers the API group and adds types to a scheme
func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme) {
func Install(groupFactoryRegistry announced.APIGroupFactoryRegistry, registry *registered.APIRegistrationManager, scheme *runtime.Scheme) {
if err := announced.NewGroupMetaFactory(
&announced.GroupMetaFactoryArgs{
GroupName: rbac.GroupName,
@@ -47,7 +47,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
v1beta1.SchemeGroupVersion.Version: v1beta1.AddToScheme,
v1alpha1.SchemeGroupVersion.Version: v1alpha1.AddToScheme,
},
).Announce().RegisterAndEnable(registry, scheme); err != nil {
).Announce(groupFactoryRegistry).RegisterAndEnable(registry, scheme); err != nil {
panic(err)
}
}