Merge pull request #13308 from timothysc/watch-cache-disable

Plumb through configuration option to disable watch cache
This commit is contained in:
Piotr Szczesniak
2015-09-04 13:40:46 +02:00
3 changed files with 11 additions and 4 deletions

View File

@@ -114,6 +114,7 @@ type Config struct {
// allow downstream consumers to disable the index route
EnableIndex bool
EnableProfiling bool
EnableWatchCache bool
APIPrefix string
ExpAPIPrefix string
CorsAllowedOriginList []string
@@ -191,6 +192,7 @@ type Master struct {
enableUISupport bool
enableSwaggerSupport bool
enableProfiling bool
enableWatchCache bool
apiPrefix string
expAPIPrefix string
corsAllowedOriginList []string
@@ -349,6 +351,7 @@ func New(c *Config) *Master {
enableUISupport: c.EnableUISupport,
enableSwaggerSupport: c.EnableSwaggerSupport,
enableProfiling: c.EnableProfiling,
enableWatchCache: c.EnableWatchCache,
apiPrefix: c.APIPrefix,
expAPIPrefix: c.ExpAPIPrefix,
corsAllowedOriginList: c.CorsAllowedOriginList,
@@ -421,10 +424,9 @@ func NewHandlerContainer(mux *http.ServeMux) *restful.Container {
// init initializes master.
func (m *Master) init(c *Config) {
enableCacher := true
healthzChecks := []healthz.HealthzChecker{}
m.clock = util.RealClock{}
podStorage := podetcd.NewStorage(c.DatabaseStorage, enableCacher, c.KubeletClient)
podStorage := podetcd.NewStorage(c.DatabaseStorage, c.EnableWatchCache, c.KubeletClient)
podTemplateStorage := podtemplateetcd.NewREST(c.DatabaseStorage)
@@ -440,10 +442,10 @@ func (m *Master) init(c *Config) {
namespaceStorage, namespaceStatusStorage, namespaceFinalizeStorage := namespaceetcd.NewREST(c.DatabaseStorage)
m.namespaceRegistry = namespace.NewRegistry(namespaceStorage)
endpointsStorage := endpointsetcd.NewREST(c.DatabaseStorage, enableCacher)
endpointsStorage := endpointsetcd.NewREST(c.DatabaseStorage, c.EnableWatchCache)
m.endpointRegistry = endpoint.NewRegistry(endpointsStorage)
nodeStorage, nodeStatusStorage := nodeetcd.NewREST(c.DatabaseStorage, enableCacher, c.KubeletClient)
nodeStorage, nodeStatusStorage := nodeetcd.NewREST(c.DatabaseStorage, c.EnableWatchCache, c.KubeletClient)
m.nodeRegistry = minion.NewRegistry(nodeStorage)
serviceStorage := serviceetcd.NewREST(c.DatabaseStorage)