mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-14 13:45:06 +00:00
Legacy scope naming should NEVER set namespace for root
... resources.
This commit is contained in:
@@ -691,6 +691,9 @@ var _ ScopeNamer = legacyScopeNaming{}
|
|||||||
|
|
||||||
// Namespace returns the namespace from the query or the default.
|
// Namespace returns the namespace from the query or the default.
|
||||||
func (n legacyScopeNaming) Namespace(req *restful.Request) (namespace string, err error) {
|
func (n legacyScopeNaming) Namespace(req *restful.Request) (namespace string, err error) {
|
||||||
|
if n.scope.Name() == meta.RESTScopeNameRoot {
|
||||||
|
return api.NamespaceNone, nil
|
||||||
|
}
|
||||||
values, ok := req.Request.URL.Query()[n.scope.ParamName()]
|
values, ok := req.Request.URL.Query()[n.scope.ParamName()]
|
||||||
if !ok || len(values) == 0 {
|
if !ok || len(values) == 0 {
|
||||||
// legacy behavior
|
// legacy behavior
|
||||||
|
Reference in New Issue
Block a user