From cd45fd6710b4f66463551871769a867898bd23ea Mon Sep 17 00:00:00 2001 From: Jordan Olshevski Date: Fri, 17 Nov 2023 13:02:04 -0600 Subject: [PATCH] Actually use the correct control plane --- internal/testutil/testutil.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/testutil/testutil.go b/internal/testutil/testutil.go index 426a8370..27d5f97f 100644 --- a/internal/testutil/testutil.go +++ b/internal/testutil/testutil.go @@ -89,17 +89,18 @@ func NewManager(t *testing.T) *Manager { // Support starting a second apiserver if requested by the environment. // Allows matrix testing against different versions of the upstream control plane. if dir := os.Getenv("UPSTREAM_KUBEBUILDER_ASSETS"); dir != "" { - env := &envtest.Environment{ + upstreamEnv := &envtest.Environment{ CRDDirectoryPaths: []string{filepath.Join(root, "api", "v1", "config", "crd")}, ErrorIfCRDPathMissing: true, + BinaryAssetsDirectory: dir, } t.Cleanup(func() { - err := env.Stop() + err := upstreamEnv.Stop() if err != nil { panic(err) } }) - m.UpstreamRestConfig, err = env.Start() + m.UpstreamRestConfig, err = upstreamEnv.Start() require.NoError(t, err) disc, err := discovery.NewDiscoveryClientForConfig(m.UpstreamRestConfig)