diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh index 412e33b4d8b..6fb3c40da8d 100755 --- a/hack/local-up-cluster.sh +++ b/hack/local-up-cluster.sh @@ -90,8 +90,9 @@ AUTH_ARGS=${AUTH_ARGS:-""} # Install a default storage class (enabled by default) DEFAULT_STORAGE_CLASS=${KUBE_DEFAULT_STORAGE_CLASS:-true} -# start the cache mutation detector by default so that cache mutators will be found -KUBE_CACHE_MUTATION_DETECTOR="${KUBE_CACHE_MUTATION_DETECTOR:-true}" +# Do not run the mutation detector by default on a local cluster. +# It is intended for a specific type of testing and inherently leaks memory. +KUBE_CACHE_MUTATION_DETECTOR="${KUBE_CACHE_MUTATION_DETECTOR:-false}" export KUBE_CACHE_MUTATION_DETECTOR # panic the server on watch decode errors since they are considered coder mistakes @@ -1037,4 +1038,4 @@ if [[ "${KUBETEST_IN_DOCKER:-}" == "true" ]]; then cluster/kubectl.sh config set-credentials myself --client-key=/var/run/kubernetes/client-admin.key --client-certificate=/var/run/kubernetes/client-admin.crt cluster/kubectl.sh config set-context local --cluster=local --user=myself cluster/kubectl.sh config use-context local -fi \ No newline at end of file +fi diff --git a/staging/src/k8s.io/client-go/tools/cache/mutation_detector.go b/staging/src/k8s.io/client-go/tools/cache/mutation_detector.go index 8e6338a1ba7..e2aa4484840 100644 --- a/staging/src/k8s.io/client-go/tools/cache/mutation_detector.go +++ b/staging/src/k8s.io/client-go/tools/cache/mutation_detector.go @@ -24,6 +24,8 @@ import ( "sync" "time" + "github.com/golang/glog" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/diff" ) @@ -43,6 +45,7 @@ func NewCacheMutationDetector(name string) CacheMutationDetector { if !mutationDetectionEnabled { return dummyMutationDetector{} } + glog.Warningln("Mutation detector is enabled, this will result in memory leakage.") return &defaultCacheMutationDetector{name: name, period: 1 * time.Second} }