Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions pkg/controller/operators/openshift/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package openshift

import (
"context"
"os"
"path/filepath"
"testing"
"time"
Expand All @@ -20,6 +21,15 @@ import (
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
)

// TestMain disables WatchListClient feature for all tests in this package.
// This is required because envtest doesn't fully support WatchList semantics in K8s 1.35.
// See: https://github.com/kubernetes/kubernetes/issues/135895
func TestMain(m *testing.M) {
// Disable WatchListClient feature gate
os.Setenv("KUBE_FEATURE_WatchListClient", "false")
os.Exit(m.Run())
}

func TestControllers(t *testing.T) {
RegisterFailHandler(Fail)

Expand Down
10 changes: 10 additions & 0 deletions pkg/controller/operators/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package operators
import (
"context"
"fmt"
"os"
"testing"
"time"

Expand Down Expand Up @@ -72,6 +73,15 @@ var (
)
)

// TestMain disables WatchListClient feature for all tests in this package.
// This is required because envtest doesn't fully support WatchList semantics in K8s 1.35.
// See: https://github.com/kubernetes/kubernetes/issues/135895
func TestMain(m *testing.M) {
// Disable WatchListClient feature gate
os.Setenv("KUBE_FEATURE_WatchListClient", "false")
os.Exit(m.Run())
}

func TestAPIs(t *testing.T) {
RegisterFailHandler(Fail)

Expand Down