Legacy scope naming should NEVER set namespace for root

... resources.
This commit is contained in:
Clayton Coleman
2015-05-08 10:13:42 -04:00
parent 964bc8afda
commit b2a2ce0bb3

View File

@@ -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