RequestInfoResolver: restrict special project logic to project API groups
@@ -4,6 +4,8 @@ import (
"net/http"
apirequest "k8s.io/apiserver/pkg/endpoints/request"
+
+ "github.com/openshift/origin/pkg/project/apis/project"
)
type projectRequestInfoResolver struct {
@@ -24,7 +26,7 @@ func (a *projectRequestInfoResolver) NewRequestInfo(req *http.Request) (*apirequ
}
// if the resource is projects, we need to set the namespace to the value of the name.
- if (requestInfo.Resource == "projects") && (len(requestInfo.Name) > 0) {
+ if (len(requestInfo.APIGroup) == 0 || requestInfo.APIGroup == project.GroupName) && requestInfo.Resource == "projects" && len(requestInfo.Name) > 0 {
requestInfo.Namespace = requestInfo.Name
}
