Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
7cc97024
Commit
7cc97024
authored
Jan 20, 2017
by
deads2k
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
separate announce factories
parent
ee70adb9
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
49 additions
and
52 deletions
+49
-52
install.go
...be-aggregator/pkg/apis/apiregistration/install/install.go
+3
-3
install.go
cmd/kubeadm/app/apis/kubeadm/install/install.go
+3
-3
BUILD
pkg/api/BUILD
+1
-0
register.go
pkg/api/register.go
+4
-0
install.go
pkg/apis/apps/install/install.go
+3
-3
install.go
pkg/apis/authentication/install/install.go
+3
-3
install.go
pkg/apis/authorization/install/install.go
+3
-3
install.go
pkg/apis/autoscaling/install/install.go
+3
-3
install.go
pkg/apis/batch/install/install.go
+3
-3
install.go
pkg/apis/certificates/install/install.go
+3
-3
install.go
pkg/apis/componentconfig/install/install.go
+3
-3
install.go
pkg/apis/extensions/install/install.go
+3
-3
install.go
pkg/apis/imagepolicy/install/install.go
+3
-3
install.go
pkg/apis/policy/install/install.go
+3
-3
install.go
pkg/apis/rbac/install/install.go
+3
-3
install.go
pkg/apis/storage/install/install.go
+3
-3
announced.go
...s.io/apimachinery/pkg/apimachinery/announced/announced.go
+0
-8
group_factory.go
.../apimachinery/pkg/apimachinery/announced/group_factory.go
+2
-2
No files found.
cmd/kube-aggregator/pkg/apis/apiregistration/install/install.go
View file @
7cc97024
...
@@ -27,11 +27,11 @@ import (
...
@@ -27,11 +27,11 @@ import (
)
)
func
init
()
{
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
// 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
(
if
err
:=
announced
.
NewGroupMetaFactory
(
&
announced
.
GroupMetaFactoryArgs
{
&
announced
.
GroupMetaFactoryArgs
{
GroupName
:
apiregistration
.
GroupName
,
GroupName
:
apiregistration
.
GroupName
,
...
@@ -43,7 +43,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
...
@@ -43,7 +43,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
announced
.
VersionToSchemeFunc
{
announced
.
VersionToSchemeFunc
{
v1alpha1
.
SchemeGroupVersion
.
Version
:
v1alpha1
.
AddToScheme
,
v1alpha1
.
SchemeGroupVersion
.
Version
:
v1alpha1
.
AddToScheme
,
},
},
)
.
Announce
()
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
)
.
Announce
(
groupFactoryRegistry
)
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
panic
(
err
)
panic
(
err
)
}
}
}
}
cmd/kubeadm/app/apis/kubeadm/install/install.go
View file @
7cc97024
...
@@ -26,11 +26,11 @@ import (
...
@@ -26,11 +26,11 @@ import (
)
)
func
init
()
{
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
// 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
(
if
err
:=
announced
.
NewGroupMetaFactory
(
&
announced
.
GroupMetaFactoryArgs
{
&
announced
.
GroupMetaFactoryArgs
{
GroupName
:
kubeadm
.
GroupName
,
GroupName
:
kubeadm
.
GroupName
,
...
@@ -41,7 +41,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
...
@@ -41,7 +41,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
announced
.
VersionToSchemeFunc
{
announced
.
VersionToSchemeFunc
{
v1alpha1
.
SchemeGroupVersion
.
Version
:
v1alpha1
.
AddToScheme
,
v1alpha1
.
SchemeGroupVersion
.
Version
:
v1alpha1
.
AddToScheme
,
},
},
)
.
Announce
()
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
)
.
Announce
(
groupFactoryRegistry
)
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
panic
(
err
)
panic
(
err
)
}
}
}
}
pkg/api/BUILD
View file @
7cc97024
...
@@ -31,6 +31,7 @@ go_library(
...
@@ -31,6 +31,7 @@ go_library(
"//pkg/util/labels:go_default_library",
"//pkg/util/labels:go_default_library",
"//vendor:github.com/davecgh/go-spew/spew",
"//vendor:github.com/davecgh/go-spew/spew",
"//vendor:k8s.io/apimachinery/pkg/api/meta",
"//vendor:k8s.io/apimachinery/pkg/api/meta",
"//vendor:k8s.io/apimachinery/pkg/apimachinery/announced",
"//vendor:k8s.io/apimachinery/pkg/apimachinery/registered",
"//vendor:k8s.io/apimachinery/pkg/apimachinery/registered",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/conversion",
"//vendor:k8s.io/apimachinery/pkg/conversion",
...
...
pkg/api/register.go
View file @
7cc97024
...
@@ -19,6 +19,7 @@ package api
...
@@ -19,6 +19,7 @@ package api
import
(
import
(
"os"
"os"
"k8s.io/apimachinery/pkg/apimachinery/announced"
"k8s.io/apimachinery/pkg/apimachinery/registered"
"k8s.io/apimachinery/pkg/apimachinery/registered"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime"
...
@@ -26,6 +27,9 @@ import (
...
@@ -26,6 +27,9 @@ import (
"k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/apimachinery/pkg/runtime/serializer"
)
)
// GroupFactoryRegistry is the APIGroupFactoryRegistry (overlaps a bit with Registry, see comments in package for details)
var
GroupFactoryRegistry
=
make
(
announced
.
APIGroupFactoryRegistry
)
// Registry is an instance of an API registry. This is an interim step to start removing the idea of a global
// Registry is an instance of an API registry. This is an interim step to start removing the idea of a global
// API registry.
// API registry.
var
Registry
=
registered
.
NewOrDie
(
os
.
Getenv
(
"KUBE_API_VERSIONS"
))
var
Registry
=
registered
.
NewOrDie
(
os
.
Getenv
(
"KUBE_API_VERSIONS"
))
...
...
pkg/apis/apps/install/install.go
View file @
7cc97024
...
@@ -28,11 +28,11 @@ import (
...
@@ -28,11 +28,11 @@ import (
)
)
func
init
()
{
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
// 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
(
if
err
:=
announced
.
NewGroupMetaFactory
(
&
announced
.
GroupMetaFactoryArgs
{
&
announced
.
GroupMetaFactoryArgs
{
GroupName
:
apps
.
GroupName
,
GroupName
:
apps
.
GroupName
,
...
@@ -43,7 +43,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
...
@@ -43,7 +43,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
announced
.
VersionToSchemeFunc
{
announced
.
VersionToSchemeFunc
{
v1beta1
.
SchemeGroupVersion
.
Version
:
v1beta1
.
AddToScheme
,
v1beta1
.
SchemeGroupVersion
.
Version
:
v1beta1
.
AddToScheme
,
},
},
)
.
Announce
()
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
)
.
Announce
(
groupFactoryRegistry
)
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
panic
(
err
)
panic
(
err
)
}
}
}
}
pkg/apis/authentication/install/install.go
View file @
7cc97024
...
@@ -29,11 +29,11 @@ import (
...
@@ -29,11 +29,11 @@ import (
)
)
func
init
()
{
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
// 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
(
if
err
:=
announced
.
NewGroupMetaFactory
(
&
announced
.
GroupMetaFactoryArgs
{
&
announced
.
GroupMetaFactoryArgs
{
GroupName
:
authentication
.
GroupName
,
GroupName
:
authentication
.
GroupName
,
...
@@ -45,7 +45,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
...
@@ -45,7 +45,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
announced
.
VersionToSchemeFunc
{
announced
.
VersionToSchemeFunc
{
v1beta1
.
SchemeGroupVersion
.
Version
:
v1beta1
.
AddToScheme
,
v1beta1
.
SchemeGroupVersion
.
Version
:
v1beta1
.
AddToScheme
,
},
},
)
.
Announce
()
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
)
.
Announce
(
groupFactoryRegistry
)
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
panic
(
err
)
panic
(
err
)
}
}
}
}
pkg/apis/authorization/install/install.go
View file @
7cc97024
...
@@ -29,11 +29,11 @@ import (
...
@@ -29,11 +29,11 @@ import (
)
)
func
init
()
{
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
// 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
(
if
err
:=
announced
.
NewGroupMetaFactory
(
&
announced
.
GroupMetaFactoryArgs
{
&
announced
.
GroupMetaFactoryArgs
{
GroupName
:
authorization
.
GroupName
,
GroupName
:
authorization
.
GroupName
,
...
@@ -45,7 +45,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
...
@@ -45,7 +45,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
announced
.
VersionToSchemeFunc
{
announced
.
VersionToSchemeFunc
{
v1beta1
.
SchemeGroupVersion
.
Version
:
v1beta1
.
AddToScheme
,
v1beta1
.
SchemeGroupVersion
.
Version
:
v1beta1
.
AddToScheme
,
},
},
)
.
Announce
()
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
)
.
Announce
(
groupFactoryRegistry
)
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
panic
(
err
)
panic
(
err
)
}
}
}
}
pkg/apis/autoscaling/install/install.go
View file @
7cc97024
...
@@ -28,11 +28,11 @@ import (
...
@@ -28,11 +28,11 @@ import (
)
)
func
init
()
{
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
// 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
(
if
err
:=
announced
.
NewGroupMetaFactory
(
&
announced
.
GroupMetaFactoryArgs
{
&
announced
.
GroupMetaFactoryArgs
{
GroupName
:
autoscaling
.
GroupName
,
GroupName
:
autoscaling
.
GroupName
,
...
@@ -43,7 +43,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
...
@@ -43,7 +43,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
announced
.
VersionToSchemeFunc
{
announced
.
VersionToSchemeFunc
{
v1
.
SchemeGroupVersion
.
Version
:
v1
.
AddToScheme
,
v1
.
SchemeGroupVersion
.
Version
:
v1
.
AddToScheme
,
},
},
)
.
Announce
()
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
)
.
Announce
(
groupFactoryRegistry
)
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
panic
(
err
)
panic
(
err
)
}
}
}
}
pkg/apis/batch/install/install.go
View file @
7cc97024
...
@@ -29,11 +29,11 @@ import (
...
@@ -29,11 +29,11 @@ import (
)
)
func
init
()
{
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
// 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
(
if
err
:=
announced
.
NewGroupMetaFactory
(
&
announced
.
GroupMetaFactoryArgs
{
&
announced
.
GroupMetaFactoryArgs
{
GroupName
:
batch
.
GroupName
,
GroupName
:
batch
.
GroupName
,
...
@@ -45,7 +45,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
...
@@ -45,7 +45,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
v1
.
SchemeGroupVersion
.
Version
:
v1
.
AddToScheme
,
v1
.
SchemeGroupVersion
.
Version
:
v1
.
AddToScheme
,
v2alpha1
.
SchemeGroupVersion
.
Version
:
v2alpha1
.
AddToScheme
,
v2alpha1
.
SchemeGroupVersion
.
Version
:
v2alpha1
.
AddToScheme
,
},
},
)
.
Announce
()
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
)
.
Announce
(
groupFactoryRegistry
)
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
panic
(
err
)
panic
(
err
)
}
}
}
}
pkg/apis/certificates/install/install.go
View file @
7cc97024
...
@@ -29,11 +29,11 @@ import (
...
@@ -29,11 +29,11 @@ import (
)
)
func
init
()
{
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
// 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
(
if
err
:=
announced
.
NewGroupMetaFactory
(
&
announced
.
GroupMetaFactoryArgs
{
&
announced
.
GroupMetaFactoryArgs
{
GroupName
:
certificates
.
GroupName
,
GroupName
:
certificates
.
GroupName
,
...
@@ -45,7 +45,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
...
@@ -45,7 +45,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
announced
.
VersionToSchemeFunc
{
announced
.
VersionToSchemeFunc
{
v1beta1
.
SchemeGroupVersion
.
Version
:
v1beta1
.
AddToScheme
,
v1beta1
.
SchemeGroupVersion
.
Version
:
v1beta1
.
AddToScheme
,
},
},
)
.
Announce
()
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
)
.
Announce
(
groupFactoryRegistry
)
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
panic
(
err
)
panic
(
err
)
}
}
}
}
pkg/apis/componentconfig/install/install.go
View file @
7cc97024
...
@@ -28,11 +28,11 @@ import (
...
@@ -28,11 +28,11 @@ import (
)
)
func
init
()
{
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
// 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
(
if
err
:=
announced
.
NewGroupMetaFactory
(
&
announced
.
GroupMetaFactoryArgs
{
&
announced
.
GroupMetaFactoryArgs
{
GroupName
:
componentconfig
.
GroupName
,
GroupName
:
componentconfig
.
GroupName
,
...
@@ -43,7 +43,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
...
@@ -43,7 +43,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
announced
.
VersionToSchemeFunc
{
announced
.
VersionToSchemeFunc
{
v1alpha1
.
SchemeGroupVersion
.
Version
:
v1alpha1
.
AddToScheme
,
v1alpha1
.
SchemeGroupVersion
.
Version
:
v1alpha1
.
AddToScheme
,
},
},
)
.
Announce
()
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
)
.
Announce
(
groupFactoryRegistry
)
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
panic
(
err
)
panic
(
err
)
}
}
}
}
pkg/apis/extensions/install/install.go
View file @
7cc97024
...
@@ -29,11 +29,11 @@ import (
...
@@ -29,11 +29,11 @@ import (
)
)
func
init
()
{
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
// 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
(
if
err
:=
announced
.
NewGroupMetaFactory
(
&
announced
.
GroupMetaFactoryArgs
{
&
announced
.
GroupMetaFactoryArgs
{
GroupName
:
extensions
.
GroupName
,
GroupName
:
extensions
.
GroupName
,
...
@@ -45,7 +45,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
...
@@ -45,7 +45,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
announced
.
VersionToSchemeFunc
{
announced
.
VersionToSchemeFunc
{
v1beta1
.
SchemeGroupVersion
.
Version
:
v1beta1
.
AddToScheme
,
v1beta1
.
SchemeGroupVersion
.
Version
:
v1beta1
.
AddToScheme
,
},
},
)
.
Announce
()
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
)
.
Announce
(
groupFactoryRegistry
)
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
panic
(
err
)
panic
(
err
)
}
}
}
}
pkg/apis/imagepolicy/install/install.go
View file @
7cc97024
...
@@ -29,11 +29,11 @@ import (
...
@@ -29,11 +29,11 @@ import (
)
)
func
init
()
{
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
// 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
(
if
err
:=
announced
.
NewGroupMetaFactory
(
&
announced
.
GroupMetaFactoryArgs
{
&
announced
.
GroupMetaFactoryArgs
{
GroupName
:
imagepolicy
.
GroupName
,
GroupName
:
imagepolicy
.
GroupName
,
...
@@ -45,7 +45,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
...
@@ -45,7 +45,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
announced
.
VersionToSchemeFunc
{
announced
.
VersionToSchemeFunc
{
v1alpha1
.
SchemeGroupVersion
.
Version
:
v1alpha1
.
AddToScheme
,
v1alpha1
.
SchemeGroupVersion
.
Version
:
v1alpha1
.
AddToScheme
,
},
},
)
.
Announce
()
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
)
.
Announce
(
groupFactoryRegistry
)
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
panic
(
err
)
panic
(
err
)
}
}
}
}
pkg/apis/policy/install/install.go
View file @
7cc97024
...
@@ -28,11 +28,11 @@ import (
...
@@ -28,11 +28,11 @@ import (
)
)
func
init
()
{
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
// 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
(
if
err
:=
announced
.
NewGroupMetaFactory
(
&
announced
.
GroupMetaFactoryArgs
{
&
announced
.
GroupMetaFactoryArgs
{
GroupName
:
policy
.
GroupName
,
GroupName
:
policy
.
GroupName
,
...
@@ -43,7 +43,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
...
@@ -43,7 +43,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
announced
.
VersionToSchemeFunc
{
announced
.
VersionToSchemeFunc
{
v1beta1
.
SchemeGroupVersion
.
Version
:
v1beta1
.
AddToScheme
,
v1beta1
.
SchemeGroupVersion
.
Version
:
v1beta1
.
AddToScheme
,
},
},
)
.
Announce
()
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
)
.
Announce
(
groupFactoryRegistry
)
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
panic
(
err
)
panic
(
err
)
}
}
}
}
pkg/apis/rbac/install/install.go
View file @
7cc97024
...
@@ -30,11 +30,11 @@ import (
...
@@ -30,11 +30,11 @@ import (
)
)
func
init
()
{
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
// 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
(
if
err
:=
announced
.
NewGroupMetaFactory
(
&
announced
.
GroupMetaFactoryArgs
{
&
announced
.
GroupMetaFactoryArgs
{
GroupName
:
rbac
.
GroupName
,
GroupName
:
rbac
.
GroupName
,
...
@@ -47,7 +47,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
...
@@ -47,7 +47,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
v1beta1
.
SchemeGroupVersion
.
Version
:
v1beta1
.
AddToScheme
,
v1beta1
.
SchemeGroupVersion
.
Version
:
v1beta1
.
AddToScheme
,
v1alpha1
.
SchemeGroupVersion
.
Version
:
v1alpha1
.
AddToScheme
,
v1alpha1
.
SchemeGroupVersion
.
Version
:
v1alpha1
.
AddToScheme
,
},
},
)
.
Announce
()
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
)
.
Announce
(
groupFactoryRegistry
)
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
panic
(
err
)
panic
(
err
)
}
}
}
}
pkg/apis/storage/install/install.go
View file @
7cc97024
...
@@ -29,11 +29,11 @@ import (
...
@@ -29,11 +29,11 @@ import (
)
)
func
init
()
{
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
// 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
(
if
err
:=
announced
.
NewGroupMetaFactory
(
&
announced
.
GroupMetaFactoryArgs
{
&
announced
.
GroupMetaFactoryArgs
{
GroupName
:
storage
.
GroupName
,
GroupName
:
storage
.
GroupName
,
...
@@ -45,7 +45,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
...
@@ -45,7 +45,7 @@ func Install(registry *registered.APIRegistrationManager, scheme *runtime.Scheme
announced
.
VersionToSchemeFunc
{
announced
.
VersionToSchemeFunc
{
v1beta1
.
SchemeGroupVersion
.
Version
:
v1beta1
.
AddToScheme
,
v1beta1
.
SchemeGroupVersion
.
Version
:
v1beta1
.
AddToScheme
,
},
},
)
.
Announce
()
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
)
.
Announce
(
groupFactoryRegistry
)
.
RegisterAndEnable
(
registry
,
scheme
);
err
!=
nil
{
panic
(
err
)
panic
(
err
)
}
}
}
}
staging/src/k8s.io/apimachinery/pkg/apimachinery/announced/announced.go
View file @
7cc97024
...
@@ -28,14 +28,6 @@ import (
...
@@ -28,14 +28,6 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime"
)
)
var
(
DefaultGroupFactoryRegistry
=
make
(
APIGroupFactoryRegistry
)
// These functions will announce your group or version.
AnnounceGroupVersion
=
DefaultGroupFactoryRegistry
.
AnnounceGroupVersion
AnnounceGroup
=
DefaultGroupFactoryRegistry
.
AnnounceGroup
)
// APIGroupFactoryRegistry allows for groups and versions to announce themselves,
// APIGroupFactoryRegistry allows for groups and versions to announce themselves,
// which simply makes them available and doesn't take other actions. Later,
// which simply makes them available and doesn't take other actions. Later,
// users of the registry can select which groups and versions they'd actually
// users of the registry can select which groups and versions they'd actually
...
...
staging/src/k8s.io/apimachinery/pkg/apimachinery/announced/group_factory.go
View file @
7cc97024
...
@@ -78,8 +78,8 @@ func NewGroupMetaFactory(groupArgs *GroupMetaFactoryArgs, versions VersionToSche
...
@@ -78,8 +78,8 @@ func NewGroupMetaFactory(groupArgs *GroupMetaFactoryArgs, versions VersionToSche
// programmer importing the wrong set of packages. If this assumption doesn't
// programmer importing the wrong set of packages. If this assumption doesn't
// work for you, just call DefaultGroupFactoryRegistry.AnnouncePreconstructedFactory
// work for you, just call DefaultGroupFactoryRegistry.AnnouncePreconstructedFactory
// yourself.
// yourself.
func
(
gmf
*
GroupMetaFactory
)
Announce
()
*
GroupMetaFactory
{
func
(
gmf
*
GroupMetaFactory
)
Announce
(
groupFactoryRegistry
APIGroupFactoryRegistry
)
*
GroupMetaFactory
{
if
err
:=
DefaultG
roupFactoryRegistry
.
AnnouncePreconstructedFactory
(
gmf
);
err
!=
nil
{
if
err
:=
g
roupFactoryRegistry
.
AnnouncePreconstructedFactory
(
gmf
);
err
!=
nil
{
panic
(
err
)
panic
(
err
)
}
}
return
gmf
return
gmf
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment