Skip to content

Commit f6c6890

Browse files
committed
client-go/reflector: use consistencydetector.IsDataConsistencyDetectionForWatchListEnabled
1 parent f7f3809 commit f6c6890

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

staging/src/k8s.io/client-go/tools/cache/reflector_data_consistency_detector.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,12 @@ package cache
1818

1919
import (
2020
"context"
21-
"os"
22-
"strconv"
2321

2422
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2523
"k8s.io/apimachinery/pkg/runtime"
2624
"k8s.io/client-go/util/consistencydetector"
2725
)
2826

29-
var dataConsistencyDetectionForWatchListEnabled = false
30-
31-
func init() {
32-
dataConsistencyDetectionForWatchListEnabled, _ = strconv.ParseBool(os.Getenv("KUBE_WATCHLIST_INCONSISTENCY_DETECTOR"))
33-
}
34-
3527
// checkWatchListDataConsistencyIfRequested performs a data consistency check only when
3628
// the KUBE_WATCHLIST_INCONSISTENCY_DETECTOR environment variable was set during a binary startup.
3729
//
@@ -42,7 +34,7 @@ func init() {
4234
// Note that this function will panic when data inconsistency is detected.
4335
// This is intentional because we want to catch it in the CI.
4436
func checkWatchListDataConsistencyIfRequested[T runtime.Object, U any](ctx context.Context, identity string, lastSyncedResourceVersion string, listFn consistencydetector.ListFunc[T], retrieveItemsFn consistencydetector.RetrieveItemsFunc[U]) {
45-
if !dataConsistencyDetectionForWatchListEnabled {
37+
if !consistencydetector.IsDataConsistencyDetectionForWatchListEnabled() {
4638
return
4739
}
4840
// for informers we pass an empty ListOptions because

0 commit comments

Comments
 (0)