Merge pull request #34988 from mwielgus/cm-fed-apiserver

Automatic merge from submit-queue

Add configmaps to federation apiserver

cc: @quinton-hoole @nikhiljindal
pull/6/head
Kubernetes Submit Queue 2016-10-24 04:12:41 -07:00 committed by GitHub
commit c615e094b8
4 changed files with 13 additions and 1 deletions

View File

@ -72,6 +72,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&api.SecretList{},
&api.Event{},
&api.EventList{},
&api.ConfigMap{},
&api.ConfigMapList{},
)
// Register Unversioned types under their own special group

View File

@ -47,6 +47,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&v1.SecretList{},
&v1.Event{},
&v1.EventList{},
&v1.ConfigMap{},
&v1.ConfigMapList{},
)
// Add common types

View File

@ -34,6 +34,7 @@ import (
"k8s.io/kubernetes/pkg/api/rest"
"k8s.io/kubernetes/pkg/apimachinery/registered"
"k8s.io/kubernetes/pkg/genericapiserver"
configmapetcd "k8s.io/kubernetes/pkg/registry/core/configmap/etcd"
eventetcd "k8s.io/kubernetes/pkg/registry/core/event/etcd"
namespaceetcd "k8s.io/kubernetes/pkg/registry/core/namespace/etcd"
secretetcd "k8s.io/kubernetes/pkg/registry/core/secret/etcd"
@ -44,6 +45,7 @@ func installCoreAPIs(s *options.ServerRunOptions, g *genericapiserver.GenericAPI
serviceStore, serviceStatusStore := serviceetcd.NewREST(restOptionsFactory.NewFor(api.Resource("service")))
namespaceStore, namespaceStatusStore, namespaceFinalizeStore := namespaceetcd.NewREST(restOptionsFactory.NewFor(api.Resource("namespaces")))
secretStore := secretetcd.NewREST(restOptionsFactory.NewFor(api.Resource("secrets")))
configMapStore := configmapetcd.NewREST(restOptionsFactory.NewFor(api.Resource("configmaps")))
eventStore := eventetcd.NewREST(restOptionsFactory.NewFor(api.Resource("events")), uint64(s.EventTTL.Seconds()))
coreResources := map[string]rest.Storage{
"secrets": secretStore,
@ -53,6 +55,7 @@ func installCoreAPIs(s *options.ServerRunOptions, g *genericapiserver.GenericAPI
"namespaces/status": namespaceStatusStore,
"namespaces/finalize": namespaceFinalizeStore,
"events": eventStore,
"configmaps": configMapStore,
}
coreGroupMeta := registered.GroupOrDie(core.GroupName)
apiGroupInfo := genericapiserver.APIGroupInfo{

View File

@ -284,7 +284,7 @@ func testCoreResourceList(t *testing.T) {
assert.Equal(t, "", apiResourceList.APIVersion)
assert.Equal(t, v1.SchemeGroupVersion.String(), apiResourceList.GroupVersion)
// Assert that there are exactly 7 resources.
assert.Equal(t, 7, len(apiResourceList.APIResources))
assert.Equal(t, 8, len(apiResourceList.APIResources))
// Verify services.
found := findResource(apiResourceList.APIResources, "services")
@ -314,6 +314,11 @@ func testCoreResourceList(t *testing.T) {
found = findResource(apiResourceList.APIResources, "secrets")
assert.NotNil(t, found)
assert.True(t, found.Namespaced)
// Verify config maps.
found = findResource(apiResourceList.APIResources, "configmaps")
assert.NotNil(t, found)
assert.True(t, found.Namespaced)
}
func testExtensionsResourceList(t *testing.T) {