mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-04 08:35:10 +00:00
client-go/util/consistencydetector: move IsDataConsistencyDetectionForWatchListEnabled
Kubernetes-commit: 32fcaf14067c3dc054c887f5060bdb3325965014
This commit is contained in:
committed by
Kubernetes Publisher
parent
a7dabba123
commit
16465459fa
@@ -19,8 +19,10 @@ package consistencydetector
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"reflect"
|
"reflect"
|
||||||
"sort"
|
"sort"
|
||||||
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"k8s.io/apimachinery/pkg/api/meta"
|
"k8s.io/apimachinery/pkg/api/meta"
|
||||||
@@ -31,6 +33,18 @@ import (
|
|||||||
"k8s.io/klog/v2"
|
"k8s.io/klog/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var dataConsistencyDetectionForWatchListEnabled = false
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
dataConsistencyDetectionForWatchListEnabled, _ = strconv.ParseBool(os.Getenv("KUBE_WATCHLIST_INCONSISTENCY_DETECTOR"))
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsDataConsistencyDetectionForWatchListEnabled returns true when
|
||||||
|
// the KUBE_WATCHLIST_INCONSISTENCY_DETECTOR environment variable was set during a binary startup.
|
||||||
|
func IsDataConsistencyDetectionForWatchListEnabled() bool {
|
||||||
|
return dataConsistencyDetectionForWatchListEnabled
|
||||||
|
}
|
||||||
|
|
||||||
type RetrieveItemsFunc[U any] func() []U
|
type RetrieveItemsFunc[U any] func() []U
|
||||||
|
|
||||||
type ListFunc[T runtime.Object] func(ctx context.Context, options metav1.ListOptions) (T, error)
|
type ListFunc[T runtime.Object] func(ctx context.Context, options metav1.ListOptions) (T, error)
|
||||||
|
@@ -1,34 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2024 The Kubernetes Authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package consistencydetector
|
|
||||||
|
|
||||||
import (
|
|
||||||
"os"
|
|
||||||
"strconv"
|
|
||||||
)
|
|
||||||
|
|
||||||
var dataConsistencyDetectionForWatchListEnabled = false
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
dataConsistencyDetectionForWatchListEnabled, _ = strconv.ParseBool(os.Getenv("KUBE_WATCHLIST_INCONSISTENCY_DETECTOR"))
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsDataConsistencyDetectionForWatchListEnabled returns true when
|
|
||||||
// the KUBE_WATCHLIST_INCONSISTENCY_DETECTOR environment variable was set during a binary startup.
|
|
||||||
func IsDataConsistencyDetectionForWatchListEnabled() bool {
|
|
||||||
return dataConsistencyDetectionForWatchListEnabled
|
|
||||||
}
|
|
Reference in New Issue
Block a user