Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configmaps to federation apiserver #34988

Merged
merged 1 commit into from
Oct 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions federation/apis/core/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions federation/apis/core/v1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&v1.SecretList{},
&v1.Event{},
&v1.EventList{},
&v1.ConfigMap{},
&v1.ConfigMapList{},
)

// Add common types
Expand Down
3 changes: 3 additions & 0 deletions federation/cmd/federation-apiserver/app/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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,
Expand All @@ -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{
Expand Down
7 changes: 6 additions & 1 deletion test/integration/federation/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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) {
Expand Down