File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package openshift
22
33import (
44 "context"
5+ "os"
56 "path/filepath"
67 "testing"
78 "time"
@@ -20,6 +21,15 @@ import (
2021 metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
2122)
2223
24+ // TestMain disables WatchListClient feature for all tests in this package.
25+ // This is required because envtest doesn't fully support WatchList semantics in K8s 1.35.
26+ // See: https://github.com/kubernetes/kubernetes/issues/135895
27+ func TestMain (m * testing.M ) {
28+ // Disable WatchListClient feature gate
29+ os .Setenv ("KUBE_FEATURE_WatchListClient" , "false" )
30+ os .Exit (m .Run ())
31+ }
32+
2333func TestControllers (t * testing.T ) {
2434 RegisterFailHandler (Fail )
2535
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package operators
33import (
44 "context"
55 "fmt"
6+ "os"
67 "testing"
78 "time"
89
7273 )
7374)
7475
76+ // TestMain disables WatchListClient feature for all tests in this package.
77+ // This is required because envtest doesn't fully support WatchList semantics in K8s 1.35.
78+ // See: https://github.com/kubernetes/kubernetes/issues/135895
79+ func TestMain (m * testing.M ) {
80+ // Disable WatchListClient feature gate
81+ os .Setenv ("KUBE_FEATURE_WatchListClient" , "false" )
82+ os .Exit (m .Run ())
83+ }
84+
7585func TestAPIs (t * testing.T ) {
7686 RegisterFailHandler (Fail )
7787
You can’t perform that action at this time.
0 commit comments