From f4c24b5ef52272fe5e473e92fe5f98bee844f8aa Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Mon, 17 Nov 2025 09:25:33 +0100 Subject: [PATCH] client-go/reflector: Improve WatchListClient disabled log message for clarity --- staging/src/k8s.io/client-go/tools/cache/reflector.go | 3 +-- staging/src/k8s.io/client-go/util/watchlist/watch_list.go | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) 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 9cb76a2f5b6..ff0aade982c 100644 --- a/staging/src/k8s.io/client-go/tools/cache/reflector.go +++ b/staging/src/k8s.io/client-go/tools/cache/reflector.go @@ -302,8 +302,7 @@ func NewReflectorWithOptions(lw ListerWatcher, expectedType interface{}, store R // Using klog.TODO() here because switching to a caller-provided contextual logger // would require an API change and updating all existing call sites. klog.TODO().V(2).Info( - "The provided ListWatcher doesn't support WatchList semantics. The feature will be disabled. If you are using a custom client, check the documentation of watchlist.DoesClientNotSupportWatchListSemantics() method", - "listWatcherType", fmt.Sprintf("%T", lw), + "The client used to build this informer/reflector doesn't support WatchList semantics. The feature will be disabled. This is expected in unit tests but not in production. For details, see the documentation of watchlist.DoesClientNotSupportWatchListSemantics().", "feature", clientfeatures.WatchListClient, ) r.useWatchList = false diff --git a/staging/src/k8s.io/client-go/util/watchlist/watch_list.go b/staging/src/k8s.io/client-go/util/watchlist/watch_list.go index 1551a49f793..3641f3baee6 100644 --- a/staging/src/k8s.io/client-go/util/watchlist/watch_list.go +++ b/staging/src/k8s.io/client-go/util/watchlist/watch_list.go @@ -90,6 +90,9 @@ type unSupportedWatchListSemantics interface { // // A client does NOT support WatchList only if // it implements `IsWatchListSemanticsUnSupported` and that returns true. +// +// For an explanation of how WatchList works, see: +// https://kubernetes.io/docs/reference/using-api/api-concepts/#streaming-lists func DoesClientNotSupportWatchListSemantics(client any) bool { lw, ok := client.(unSupportedWatchListSemantics) if !ok {