diff --git a/Makefile b/Makefile index 31fe829..685abdb 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,8 @@ OUT := $(shell pwd)/_out KUBE_VERSION=1.21.2 $(shell mkdir -p "$(OUT)") +export TEST_ASSET_ETCD=_test/kubebuilder/bin/etcd +export TEST_ASSET_KUBE_APISERVER=_test/kubebuilder/bin/kube-apiserver test: _test/kubebuilder go test -v . diff --git a/go.sum b/go.sum index cdd24fb..51d9de6 100644 --- a/go.sum +++ b/go.sum @@ -38,6 +38,7 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/Azure/azure-sdk-for-go v56.2.0+incompatible h1:2GrG1JkTSMqLquy1pqVsjeRJhNtZLjss2+rx8ogZXx4= github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= diff --git a/main.go b/main.go index 39602dc..33937cb 100644 --- a/main.go +++ b/main.go @@ -3,9 +3,9 @@ package main import ( "encoding/json" "fmt" - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "os" + extapi "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" //"k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" @@ -133,7 +133,7 @@ func (c *customDNSProviderSolver) Initialize(kubeClientConfig *rest.Config, stop // loadConfig is a small helper function that decodes JSON configuration into // the typed config struct. -func loadConfig(cfgJSON *v1.JSON) (customDNSProviderConfig, error) { +func loadConfig(cfgJSON *extapi.JSON) (customDNSProviderConfig, error) { cfg := customDNSProviderConfig{} // handle the 'base case' where no configuration has been provided if cfgJSON == nil { diff --git a/main_test.go b/main_test.go index 2183310..a139578 100644 --- a/main_test.go +++ b/main_test.go @@ -26,10 +26,6 @@ func TestRunsSuite(t *testing.T) { // dns.SetManifestPath("testdata/my-custom-solver"), // dns.SetBinariesPath("_test/kubebuilder/bin"), //) - os.Setenv("TEST_ASSET_ETCD", "_test/kubebuilder/bin/etcd") - os.Setenv("TEST_ASSET_KUBE_APISERVER", "_test/kubebuilder/bin/kube-apiserver") - defer os.Unsetenv("TEST_ASSET_ETCD") - defer os.Unsetenv("TEST_ASSET_KUBE_APISERVER") solver := example.New("59351") fixture := dns.NewFixture(solver, dns.SetResolvedZone("example.com."), @@ -40,4 +36,5 @@ func TestRunsSuite(t *testing.T) { fixture.RunBasic(t) fixture.RunExtended(t) + }