diff --git a/.gitignore b/.gitignore index 7dcb1e9..9d1872f 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,6 @@ # Ignore the built binary cert-manager-webhook-example + +# Test Binaries +kubebuilder \ No newline at end of file diff --git a/main_test.go b/main_test.go index 4e32419..30a0bdc 100644 --- a/main_test.go +++ b/main_test.go @@ -9,6 +9,7 @@ import ( var ( zone = os.Getenv("TEST_ZONE_NAME") + kubeBuilderBinPath = "./kubebuilder/bin" ) func TestRunsSuite(t *testing.T) { @@ -17,6 +18,7 @@ func TestRunsSuite(t *testing.T) { // ChallengeRequest passed as part of the test cases. fixture := dns.NewFixture(&customDNSProviderSolver{}, + dns.SetBinariesPath(kubeBuilderBinPath), dns.SetResolvedZone(zone), dns.SetAllowAmbientCredentials(false), dns.SetManifestPath("testdata/my-custom-solver"), diff --git a/scripts/fetch-test-binaries.sh b/scripts/fetch-test-binaries.sh index f1f641a..4bc83fd 100755 --- a/scripts/fetch-test-binaries.sh +++ b/scripts/fetch-test-binaries.sh @@ -1 +1,10 @@ #!/usr/bin/env bash +os=$(go env GOOS) +arch=$(go env GOARCH) + +# download kubebuilder and extract it to tmp +curl -L https://go.kubebuilder.io/dl/2.3.1/${os}/${arch} | tar -xz -C /tmp/ + +# move to a long-term location and put it on your path +# (you'll need to set the KUBEBUILDER_ASSETS env var if you put it somewhere else) +mv /tmp/kubebuilder_2.3.1_${os}_${arch} ./kubebuilder \ No newline at end of file