Allow watch cache to be disabled per type

Currently setting watch cache size for a given resource does not disable
the watch cache. This commit adds a new `default-watch-cache-size` flag
to map to the existing field, and refactors how watch cache sizes are
calculated to bring all of the code into one place. It also adds debug
logging to startup to allow us to verify watch cache enablement in
production.
This commit is contained in:
Clayton Coleman
2017-09-07 16:59:31 -04:00
parent 629fea3ef6
commit fc2d201e15
88 changed files with 113 additions and 239 deletions

View File

@@ -38,7 +38,6 @@ go_library(
"//pkg/printers:go_default_library",
"//pkg/printers/internalversion:go_default_library",
"//pkg/printers/storage:go_default_library",
"//pkg/registry/cachesize:go_default_library",
"//pkg/registry/core/replicationcontroller:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",

View File

@@ -36,7 +36,6 @@ import (
"k8s.io/kubernetes/pkg/printers"
printersinternal "k8s.io/kubernetes/pkg/printers/internalversion"
printerstorage "k8s.io/kubernetes/pkg/printers/storage"
"k8s.io/kubernetes/pkg/registry/cachesize"
"k8s.io/kubernetes/pkg/registry/core/replicationcontroller"
)
@@ -70,7 +69,6 @@ func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST) {
NewListFunc: func() runtime.Object { return &api.ReplicationControllerList{} },
PredicateFunc: replicationcontroller.MatchController,
DefaultQualifiedResource: api.Resource("replicationcontrollers"),
WatchCacheSize: cachesize.GetWatchCacheSizeByResource("replicationcontrollers"),
CreateStrategy: replicationcontroller.Strategy,
UpdateStrategy: replicationcontroller.Strategy,