diff --git a/pkg/apiserver/api_installer.go b/pkg/apiserver/api_installer.go index 7b27c94f794..59a83bbf6e8 100644 --- a/pkg/apiserver/api_installer.go +++ b/pkg/apiserver/api_installer.go @@ -691,6 +691,9 @@ var _ ScopeNamer = legacyScopeNaming{} // Namespace returns the namespace from the query or the default. 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()] if !ok || len(values) == 0 { // legacy behavior