Skip to content

Commit 09572f8

Browse files
pasanwclaude
andcommitted
fix: disable WatchListClient feature gate in installation tests
k8s.io/client-go v0.35.0 defaults the WatchListClient feature gate to true. This causes reflectors to use watch-list semantics which require bookmark events from the API server. The fake clientset doesn't send bookmark events, causing informers to hang indefinitely on HasSynced(). Set KUBE_FEATURE_WatchListClient=false in an init() function in the test suite to ensure it takes effect before any informer is created. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ba04c98 commit 09572f8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/controller/installation/installation_controller_suite_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package installation
1616

1717
import (
18+
"os"
1819
"testing"
1920

2021
"github.com/onsi/ginkgo/v2"
@@ -25,6 +26,14 @@ import (
2526
"sigs.k8s.io/controller-runtime/pkg/log/zap"
2627
)
2728

29+
func init() {
30+
// Disable WatchListClient feature gate for fake clientset compatibility.
31+
// k8s.io/client-go v0.35.0 defaults WatchListClient to true, which makes
32+
// reflectors require bookmark events that the fake clientset doesn't send,
33+
// causing informers to hang indefinitely on HasSynced().
34+
os.Setenv("KUBE_FEATURE_WatchListClient", "false")
35+
}
36+
2837
func TestInstallation(t *testing.T) {
2938
logf.SetLogger(zap.New(zap.WriteTo(ginkgo.GinkgoWriter), zap.UseDevMode(true), zap.Level(uzap.NewAtomicLevelAt(uzap.DebugLevel))))
3039
gomega.RegisterFailHandler(ginkgo.Fail)

0 commit comments

Comments
 (0)