Skip to content

Commit

Permalink
Actually use the correct control plane
Browse files Browse the repository at this point in the history
  • Loading branch information
jveski committed Nov 17, 2023
1 parent e0f3366 commit cd45fd6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/testutil/testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cd45fd6

Please sign in to comment.