Skip to content

Commit 01b4f84

Browse files
committed
Set default envtest binary asset directory
This saves a step - having to set KUBEBUILDER_ASSETS envar - when running an integration test suite on directly on via CLI or IDE. Top level Makefile still sets KUBEBUILDER_ASSETS so that behavior is unchanged.
1 parent a148db0 commit 01b4f84

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/builder/test_suite.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3030
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
3131
"k8s.io/client-go/rest"
32-
klog "k8s.io/klog/v2"
32+
"k8s.io/klog/v2"
3333
"k8s.io/klog/v2/klogr"
3434
"sigs.k8s.io/controller-runtime/pkg/client"
3535
"sigs.k8s.io/controller-runtime/pkg/envtest"
@@ -224,7 +224,8 @@ func (s *TestSuite) init(crdPaths []string) {
224224

225225
if s.flags.IntegrationTestsEnabled {
226226
s.envTest = envtest.Environment{
227-
CRDDirectoryPaths: crdPaths,
227+
CRDDirectoryPaths: crdPaths,
228+
BinaryAssetsDirectory: filepath.Join(testutil.GetRootDirOrDie(), "hack", "tools", "bin"),
228229
}
229230
}
230231
}

0 commit comments

Comments
 (0)