Commit ecbca9eb authored by Clayton Coleman's avatar Clayton Coleman

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.
parent 84d1f190
...@@ -320,9 +320,11 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag ...@@ -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, nameParams, namer}, isConnecter)
actions = appendIf(actions, action{"CONNECT", itemPath + "/{path:*}", nameParams, namer}, isConnecter && connectSubpath) 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} 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{"LIST", resource, params, namer}, isLister)
actions = appendIf(actions, action{"POST", resource, params, namer}, isCreater)
actions = appendIf(actions, action{"WATCHLIST", "watch/" + resource, params, namer}, allowWatchList) actions = appendIf(actions, action{"WATCHLIST", "watch/" + resource, params, namer}, allowWatchList)
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment