From 19e5c8565d444cbb81d554a69960d7144996b05a Mon Sep 17 00:00:00 2001 From: RainbowMango Date: Wed, 4 Sep 2019 18:32:06 +0800 Subject: [PATCH] Cleanup staticcheck from staging/src/k8s.io/client-go/tools/cache. --- hack/.staticcheck_failures | 1 - .../src/k8s.io/client-go/tools/cache/delta_fifo.go | 7 ------- .../src/k8s.io/client-go/tools/cache/reflector.go | 5 ----- .../client-go/tools/cache/reflector_metrics.go | 13 ------------- 4 files changed, 26 deletions(-) diff --git a/hack/.staticcheck_failures b/hack/.staticcheck_failures index 4e325233cb4..92dff7659cd 100644 --- a/hack/.staticcheck_failures +++ b/hack/.staticcheck_failures @@ -213,7 +213,6 @@ vendor/k8s.io/client-go/metadata/fake vendor/k8s.io/client-go/rest vendor/k8s.io/client-go/rest/watch vendor/k8s.io/client-go/restmapper -vendor/k8s.io/client-go/tools/cache vendor/k8s.io/client-go/tools/leaderelection vendor/k8s.io/client-go/transport vendor/k8s.io/cloud-provider/service/helpers diff --git a/staging/src/k8s.io/client-go/tools/cache/delta_fifo.go b/staging/src/k8s.io/client-go/tools/cache/delta_fifo.go index db4519f2e5d..1db3a01b6cb 100644 --- a/staging/src/k8s.io/client-go/tools/cache/delta_fifo.go +++ b/staging/src/k8s.io/client-go/tools/cache/delta_fifo.go @@ -539,13 +539,6 @@ func (f *DeltaFIFO) Resync() error { return nil } -func (f *DeltaFIFO) syncKey(key string) error { - f.lock.Lock() - defer f.lock.Unlock() - - return f.syncKeyLocked(key) -} - func (f *DeltaFIFO) syncKeyLocked(key string) error { obj, exists, err := f.knownObjects.GetByKey(key) if err != nil { diff --git a/staging/src/k8s.io/client-go/tools/cache/reflector.go b/staging/src/k8s.io/client-go/tools/cache/reflector.go index 8abde7131a3..c5488f8abf4 100644 --- a/staging/src/k8s.io/client-go/tools/cache/reflector.go +++ b/staging/src/k8s.io/client-go/tools/cache/reflector.go @@ -45,8 +45,6 @@ import ( type Reflector struct { // name identifies this reflector. By default it will be a file:line if possible. name string - // metrics tracks basic metric information about the reflector - metrics *reflectorMetrics // The type of object we expect to place in the store. expectedType reflect.Type @@ -129,9 +127,6 @@ var ( // nothing will ever be sent down this channel neverExitWatch <-chan time.Time = make(chan time.Time) - // Used to indicate that watching stopped so that a resync could happen. - errorResyncRequested = errors.New("resync channel fired") - // Used to indicate that watching stopped because of a signal from the stop // channel passed in from a client of the reflector. errorStopRequested = errors.New("Stop requested") diff --git a/staging/src/k8s.io/client-go/tools/cache/reflector_metrics.go b/staging/src/k8s.io/client-go/tools/cache/reflector_metrics.go index dd849c8fa1b..5c00115f59b 100644 --- a/staging/src/k8s.io/client-go/tools/cache/reflector_metrics.go +++ b/staging/src/k8s.io/client-go/tools/cache/reflector_metrics.go @@ -47,19 +47,6 @@ func (noopMetric) Dec() {} func (noopMetric) Observe(float64) {} func (noopMetric) Set(float64) {} -type reflectorMetrics struct { - numberOfLists CounterMetric - listDuration SummaryMetric - numberOfItemsInList SummaryMetric - - numberOfWatches CounterMetric - numberOfShortWatches CounterMetric - watchDuration SummaryMetric - numberOfItemsInWatch SummaryMetric - - lastResourceVersion GaugeMetric -} - // MetricsProvider generates various metrics used by the reflector. type MetricsProvider interface { NewListsMetric(name string) CounterMetric