Repository: gardener/external-dns-management
Pull request #59 (2020-03-19 20:01:46)

adjustments for running tests with kind v0.7.0
**What this PR does / why we need it**:
adjustments for running tests with kind v0.7.0

**Which issue(s) this PR fixes**:
Fixes #

**Special notes for your reviewer**:

**Release note**:
<!--  Write your release note:
1. Enter your release note in the below block.
2. If no release note is required, just write "NONE" within the block.

Format of block header: <category> <target_group>
Possible values:
- category:       improvement|noteworthy|action
- target_group:   user|operator|developer
-->
```improvement operator

```



Patch:
diff --git a/.gitignore b/.gitignore
index 1b6342eb..c06c5084 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,4 @@ tmp/
 /test/integration/kubebuilder*
 /test/integration/default.etcd
 .vscode/
+.kubeconfig-kind-integration
diff --git a/go.mod b/go.mod
index 11839776..2239dcbf 100644
--- a/go.mod
+++ b/go.mod
@@ -38,5 +38,3 @@ require (
 	k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a
 	sigs.k8s.io/kind v0.7.0
 )
-
-replace gopkg.in/fsnotify.v1 v1.4.7 => github.com/fsnotify/fsnotify v1.4.7
diff --git a/go.sum b/go.sum
index 2dbd5d17..ad15d021 100644
--- a/go.sum
+++ b/go.sum
@@ -444,6 +444,8 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
+gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
 gopkg.in/inf.v0 v0.9.0/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
 gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
 gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
diff --git a/pkg/controller/provider/azure/handler.go b/pkg/controller/provider/azure/handler.go
index c3bcb8c7..e196f890 100644
--- a/pkg/controller/provider/azure/handler.go
+++ b/pkg/controller/provider/azure/handler.go
@@ -79,9 +79,11 @@ func NewHandler(c *provider.DNSHandlerConfig) (provider.DNSHandler, error) {
 
 	zonesClient.Authorizer = authorizer
 	recordsClient.Authorizer = authorizer
+
 	// dummy call to check authentication
 	var one int32 = 1
-	_, err = zonesClient.List(h.ctx, &one)
+	ctx := context.TODO()
+	_, err = zonesClient.List(ctx, &one)
 	if err != nil {
 		return nil, fmt.Errorf("Authentication test to Azure with client credentials failed. Please check secret for DNSProvider. Details: %s", err.Error())
 	}
diff --git a/vendor/modules.txt b/vendor/modules.txt
index a073d7b7..acec79cc 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -401,7 +401,7 @@ google.golang.org/grpc/serviceconfig
 google.golang.org/grpc/stats
 google.golang.org/grpc/status
 google.golang.org/grpc/tap
-# gopkg.in/fsnotify.v1 v1.4.7 => github.com/fsnotify/fsnotify v1.4.7
+# gopkg.in/fsnotify.v1 v1.4.7
 gopkg.in/fsnotify.v1
 # gopkg.in/inf.v0 v0.9.1
 gopkg.in/inf.v0


Test patch:
diff --git a/test/functional/run.sh b/test/functional/run.sh
index 765a14a2..9f23197b 100755
--- a/test/functional/run.sh
+++ b/test/functional/run.sh
@@ -16,8 +16,9 @@
 
 set -e
 SCRIPT_BASEDIR=$(dirname "$0")
-ROOTDIR=../..
+ROOTDIR=$(readlink -f $SCRIPT_BASEDIR/../..)
 echo ROOTDIR: $ROOTDIR
+INTEGRATION_KUBECONFIG=$ROOTDIR/.kubeconfig-kind-integration
 
 cd $SCRIPT_BASEDIR
 
@@ -164,6 +165,11 @@ if [ "$NOBOOTSTRAP" == "" ] && [ "$LOCAL_APISERVER" == "" ]; then
   # prepare Kubernetes IN Docker - local clusters for testing Kubernetes
   go install -mod=vendor sigs.k8s.io/kind
 
+
+  rm $INTEGRATION_KUBECONFIG || true
+  touch $INTEGRATION_KUBECONFIG
+  export KUBECONFIG=$INTEGRATION_KUBECONFIG
+
   # delete old cluster
   kind delete cluster --name integration || true
 
@@ -224,7 +230,7 @@ users: []
 EOF
   export KUBECONFIG=/tmp/kubeconfig-local.yaml
 else
-  export KUBECONFIG=$(kind get kubeconfig-path --name="integration")
+  export KUBECONFIG=$INTEGRATION_KUBECONFIG
 fi
 
 kubectl cluster-info
diff --git a/test/integration/run.sh b/test/integration/run.sh
index 4ac36ff0..7d2d4b1f 100755
--- a/test/integration/run.sh
+++ b/test/integration/run.sh
@@ -18,6 +18,7 @@ set -e
 SCRIPT_BASEDIR=$(dirname "$0")
 ROOTDIR=$SCRIPT_BASEDIR/../..
 echo ROOTDIR: $ROOTDIR
+INTEGRATION_KUBECONFIG=$(readlink -f $ROOTDIR/.kubeconfig-kind-integration)
 
 usage()
 {
@@ -77,6 +78,10 @@ if [ "$NOBOOTSTRAP" == "" ] && [ "$LOCAL_APISERVER" == "" ]; then
   # prepare Kubernetes IN Docker - local clusters for testing Kubernetes
   go install -mod=vendor sigs.k8s.io/kind
 
+  rm $INTEGRATION_KUBECONFIG || true
+  touch $INTEGRATION_KUBECONFIG
+  export KUBECONFIG=$INTEGRATION_KUBECONFIG
+
   # delete old cluster
   kind delete cluster --name integration || true
 
@@ -140,7 +145,7 @@ users: []
 EOF
   export KUBECONFIG=/tmp/kubeconfig-local.yaml
 else
-  export KUBECONFIG=$(kind get kubeconfig-path --name="integration")
+  export KUBECONFIG=$INTEGRATION_KUBECONFIG
 fi
 
 kubectl cluster-info