@@ -17,6 +17,7 @@ import (
17
17
"k8s.io/kubernetes/pkg/api/unversioned"
18
18
"k8s.io/kubernetes/pkg/apiserver"
19
19
"k8s.io/kubernetes/pkg/client/cache"
20
+ "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
20
21
"k8s.io/kubernetes/pkg/client/restclient"
21
22
kclient "k8s.io/kubernetes/pkg/client/unversioned"
22
23
clientadapter "k8s.io/kubernetes/pkg/client/unversioned/adapters/internalclientset"
@@ -68,6 +69,7 @@ import (
68
69
projectcache "github.com/openshift/origin/pkg/project/cache"
69
70
"github.com/openshift/origin/pkg/quota"
70
71
quotaadmission "github.com/openshift/origin/pkg/quota/admission/resourcequota"
72
+ "github.com/openshift/origin/pkg/quota/controller/clusterquotamapping"
71
73
"github.com/openshift/origin/pkg/serviceaccounts"
72
74
usercache "github.com/openshift/origin/pkg/user/cache"
73
75
groupregistry "github.com/openshift/origin/pkg/user/registry/group"
@@ -76,7 +78,6 @@ import (
76
78
useretcd "github.com/openshift/origin/pkg/user/registry/user/etcd"
77
79
"github.com/openshift/origin/pkg/util/leaderlease"
78
80
"github.com/openshift/origin/pkg/util/restoptions"
79
- "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
80
81
)
81
82
82
83
// MasterConfig defines the required parameters for starting the OpenShift master
@@ -91,9 +92,10 @@ type MasterConfig struct {
91
92
Authorizer authorizer.Authorizer
92
93
AuthorizationAttributeBuilder authorizer.AuthorizationAttributeBuilder
93
94
94
- GroupCache * usercache.GroupCache
95
- ProjectAuthorizationCache * projectauth.AuthorizationCache
96
- ProjectCache * projectcache.ProjectCache
95
+ GroupCache * usercache.GroupCache
96
+ ProjectAuthorizationCache * projectauth.AuthorizationCache
97
+ ProjectCache * projectcache.ProjectCache
98
+ ClusterQuotaMappingController * clusterquotamapping.ClusterQuotaMappingController
97
99
98
100
// RequestContextMapper maps requests to contexts
99
101
RequestContextMapper kapi.RequestContextMapper
@@ -197,6 +199,7 @@ func BuildMasterConfig(options configapi.MasterConfig) (*MasterConfig, error) {
197
199
}
198
200
groupCache := usercache .NewGroupCache (groupregistry .NewRegistry (groupStorage ))
199
201
projectCache := projectcache .NewProjectCache (privilegedLoopbackKubeClient .Namespaces (), options .ProjectConfig .DefaultNodeSelector )
202
+ clusterQuotaMappingController := clusterquotamapping .NewClusterQuotaMappingController (informerFactory .Namespaces (), informerFactory .ClusterResourceQuotas ())
200
203
201
204
kubeletClientConfig := configapi .GetKubeletClientConfig (options )
202
205
@@ -274,9 +277,10 @@ func BuildMasterConfig(options configapi.MasterConfig) (*MasterConfig, error) {
274
277
Authorizer : authorizer ,
275
278
AuthorizationAttributeBuilder : newAuthorizationAttributeBuilder (requestContextMapper ),
276
279
277
- GroupCache : groupCache ,
278
- ProjectAuthorizationCache : newProjectAuthorizationCache (authorizer , privilegedLoopbackKubeClient , informerFactory ),
279
- ProjectCache : projectCache ,
280
+ GroupCache : groupCache ,
281
+ ProjectAuthorizationCache : newProjectAuthorizationCache (authorizer , privilegedLoopbackKubeClient , informerFactory ),
282
+ ProjectCache : projectCache ,
283
+ ClusterQuotaMappingController : clusterQuotaMappingController ,
280
284
281
285
RequestContextMapper : requestContextMapper ,
282
286
0 commit comments