mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-13 21:25:09 +00:00
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.
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user