From ecbca9eb171b9a1f978b9676595db1dac181fa90 Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Mon, 11 May 2015 10:07:34 -0400 Subject: [PATCH] Allow v1beta3 to POST events to all namespaces A namespaced resource that supports ALL may allow creation on the root (all namespaces) collection, thus adding POST here. We need to better formalize the definition of calls on namespaced resources at the root scope, so Storage objects that do not support that call pattern can do so at definition time and reject those calls. --- pkg/apiserver/api_installer.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/apiserver/api_installer.go b/pkg/apiserver/api_installer.go index 711d01df718..7aa68b871c0 100644 --- a/pkg/apiserver/api_installer.go +++ b/pkg/apiserver/api_installer.go @@ -320,9 +320,11 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag actions = appendIf(actions, action{"CONNECT", itemPath, nameParams, namer}, isConnecter) actions = appendIf(actions, action{"CONNECT", itemPath + "/{path:*}", nameParams, namer}, isConnecter && connectSubpath) - // list across namespace. + // list or post across namespace. + // TODO: more strongly type whether a resource allows these actions on "all namespaces" (bulk delete) namer = scopeNaming{scope, a.group.Linker, gpath.Join(a.prefix, itemPath), true} actions = appendIf(actions, action{"LIST", resource, params, namer}, isLister) + actions = appendIf(actions, action{"POST", resource, params, namer}, isCreater) actions = appendIf(actions, action{"WATCHLIST", "watch/" + resource, params, namer}, allowWatchList) } else {