Repository: kubermatic/machine-controller
Pull request #1637 (2023-05-10 15:13:18)

Anexia Provider: Configure dns servers
**What this PR does / why we need it**:
Add dns server configuration to vm definition

**What type of PR is this?**
<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind design

Optionally add one or more of the following kinds if applicable:
/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
/kind chore
-->
/kind feature

**Special notes for your reviewer**:

**Does this PR introduce a user-facing change? Then add your Release Note here**:
<!--
Write your release note:
1. Enter your extended release note in the below block. If the PR requires additional action from users switching to the new release, include the string "action required".
2. If no release note is required, just write "NONE".
-->
```release-note
Anexia Provider: Enable up to 4 custom dns entries
```

**Documentation**:
<!--
Please do one of the following options:
- Add a link to the existing documentation
- Add a link to the kubermatic/docs pull request
- If no documentation change is applicable then add:
  - TBD (documentation will be added later)
  - NONE (no documentation needed for this PR)
-->
```documentation
NONE
```


kubermatic-bot: Hi @eiabea. Thanks for your PR.

I'm waiting for a [kubermatic](https://github.com/orgs/kubermatic/people) member to verify that this patch is reasonable to test. If it is, they should reply with `/ok-to-test` on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should [join the org](https://github.com/orgs/kubermatic/people) to skip this step.

Once the patch is verified, the new status will be reflected by the `ok-to-test` label.

I understand the commands that are listed [here](https://go.k8s.io/bot-commands?repo=kubermatic%2Fmachine-controller).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
</details>


Patch:
diff --git a/.prow/postsubmits.yaml b/.prow/postsubmits.yaml
index f4ecca9d..da280c4d 100644
--- a/.prow/postsubmits.yaml
+++ b/.prow/postsubmits.yaml
@@ -26,7 +26,7 @@ postsubmits:
       preset-goproxy: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - /bin/bash
             - -c
@@ -54,7 +54,7 @@ postsubmits:
       preset-goproxy: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/upload-gocache.sh"
           resources:
diff --git a/.prow/provider-alibaba.yaml b/.prow/provider-alibaba.yaml
index a424ee67..a0719456 100644
--- a/.prow/provider-alibaba.yaml
+++ b/.prow/provider-alibaba.yaml
@@ -29,7 +29,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
diff --git a/.prow/provider-anexia.yaml b/.prow/provider-anexia.yaml
index 99f79b4a..02afe578 100644
--- a/.prow/provider-anexia.yaml
+++ b/.prow/provider-anexia.yaml
@@ -31,7 +31,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
diff --git a/.prow/provider-aws.yaml b/.prow/provider-aws.yaml
index dc4a5a3f..9203abd0 100644
--- a/.prow/provider-aws.yaml
+++ b/.prow/provider-aws.yaml
@@ -28,7 +28,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
@@ -60,7 +60,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           env:
             - name: OPERATING_SYSTEM_MANAGER
               value: "false"
@@ -93,7 +93,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
@@ -124,7 +124,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
@@ -156,7 +156,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
@@ -187,7 +187,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
@@ -218,7 +218,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
@@ -249,7 +249,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
diff --git a/.prow/provider-azure.yaml b/.prow/provider-azure.yaml
index 95780707..f3e02990 100644
--- a/.prow/provider-azure.yaml
+++ b/.prow/provider-azure.yaml
@@ -28,7 +28,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
@@ -60,7 +60,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
@@ -93,7 +93,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
diff --git a/.prow/provider-digitalocean.yaml b/.prow/provider-digitalocean.yaml
index 44e09b82..fd84cc73 100644
--- a/.prow/provider-digitalocean.yaml
+++ b/.prow/provider-digitalocean.yaml
@@ -27,7 +27,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
diff --git a/.prow/provider-equinix-metal.yaml b/.prow/provider-equinix-metal.yaml
index 6659d980..f1c6f4ba 100644
--- a/.prow/provider-equinix-metal.yaml
+++ b/.prow/provider-equinix-metal.yaml
@@ -28,7 +28,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
diff --git a/.prow/provider-gcp.yaml b/.prow/provider-gcp.yaml
index 21ee1756..5631bf42 100644
--- a/.prow/provider-gcp.yaml
+++ b/.prow/provider-gcp.yaml
@@ -28,7 +28,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
diff --git a/.prow/provider-hetzner.yaml b/.prow/provider-hetzner.yaml
index 0200e89e..7e7a9e95 100644
--- a/.prow/provider-hetzner.yaml
+++ b/.prow/provider-hetzner.yaml
@@ -26,7 +26,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
diff --git a/.prow/provider-kubevirt.yaml b/.prow/provider-kubevirt.yaml
index 4ae7aed9..64234992 100644
--- a/.prow/provider-kubevirt.yaml
+++ b/.prow/provider-kubevirt.yaml
@@ -29,7 +29,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
diff --git a/.prow/provider-linode.yaml b/.prow/provider-linode.yaml
index 80276976..f6bea60f 100644
--- a/.prow/provider-linode.yaml
+++ b/.prow/provider-linode.yaml
@@ -28,7 +28,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
diff --git a/.prow/provider-nutanix.yaml b/.prow/provider-nutanix.yaml
index 44a2e5f3..149c649d 100644
--- a/.prow/provider-nutanix.yaml
+++ b/.prow/provider-nutanix.yaml
@@ -27,7 +27,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
diff --git a/.prow/provider-openstack.yaml b/.prow/provider-openstack.yaml
index 0a73d28f..e59fde74 100644
--- a/.prow/provider-openstack.yaml
+++ b/.prow/provider-openstack.yaml
@@ -28,7 +28,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
@@ -60,7 +60,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
diff --git a/.prow/provider-scaleway.yaml b/.prow/provider-scaleway.yaml
index 3897873b..c1c35947 100644
--- a/.prow/provider-scaleway.yaml
+++ b/.prow/provider-scaleway.yaml
@@ -27,7 +27,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
diff --git a/.prow/provider-vmware-cloud-director.yaml b/.prow/provider-vmware-cloud-director.yaml
index 73e7f4a6..25b63cee 100644
--- a/.prow/provider-vmware-cloud-director.yaml
+++ b/.prow/provider-vmware-cloud-director.yaml
@@ -29,7 +29,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
diff --git a/.prow/provider-vsphere.yaml b/.prow/provider-vsphere.yaml
index 2099a030..4c4df817 100644
--- a/.prow/provider-vsphere.yaml
+++ b/.prow/provider-vsphere.yaml
@@ -28,7 +28,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
@@ -60,7 +60,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
@@ -92,7 +92,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
diff --git a/.prow/verify.yaml b/.prow/verify.yaml
index ad2f4885..d0745f3e 100644
--- a/.prow/verify.yaml
+++ b/.prow/verify.yaml
@@ -21,7 +21,7 @@ presubmits:
       preset-goproxy: "true"
     spec:
       containers:
-        - image: golang:1.20.3
+        - image: golang:1.20.4
           command:
             - make
           args:
@@ -42,7 +42,7 @@ presubmits:
       preset-goproxy: "true"
     spec:
       containers:
-        - image: golang:1.20.3
+        - image: golang:1.20.4
           command:
             - make
           args:
@@ -149,7 +149,7 @@ presubmits:
       preset-goproxy: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - ./hack/verify-licenses.sh
           resources:
@@ -165,7 +165,7 @@ presubmits:
       preset-goproxy: "true"
     spec:
       containers:
-        - image: golang:1.20.3
+        - image: golang:1.20.4
           command:
             - make
           args:
diff --git a/Dockerfile b/Dockerfile
index 2d0c45d2..7329a4f1 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-ARG GO_VERSION=1.20.3
+ARG GO_VERSION=1.20.4
 FROM docker.io/golang:${GO_VERSION} AS builder
 WORKDIR /go/src/github.com/kubermatic/machine-controller
 COPY . .
diff --git a/Makefile b/Makefile
index e6f40e70..0f468ea3 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@
 
 SHELL = /bin/bash -eu -o pipefail
 
-GO_VERSION ?= 1.20.3
+GO_VERSION ?= 1.20.4
 
 GOOS ?= $(shell go env GOOS)
 
diff --git a/hack/update-fixtures.sh b/hack/update-fixtures.sh
index 790c2e14..b34ec94b 100755
--- a/hack/update-fixtures.sh
+++ b/hack/update-fixtures.sh
@@ -19,7 +19,7 @@ set -euo pipefail
 cd $(dirname $0)/..
 source hack/lib.sh
 
-CONTAINERIZE_IMAGE=golang:1.20.3 containerize ./hack/update-fixtures.sh
+CONTAINERIZE_IMAGE=golang:1.20.4 containerize ./hack/update-fixtures.sh
 
 go test ./... -v -update || go test ./...
 
diff --git a/pkg/cloudprovider/provider/anexia/provider.go b/pkg/cloudprovider/provider/anexia/provider.go
index 6b51e714..8b2ca206 100644
--- a/pkg/cloudprovider/provider/anexia/provider.go
+++ b/pkg/cloudprovider/provider/anexia/provider.go
@@ -96,17 +96,18 @@ func (p *provider) Create(ctx context.Context, log *zap.SugaredLogger, machine *
 	// ensure conditions are present on machine
 	ensureConditions(&status)
 
-	config, _, err := p.getConfig(ctx, log, machine.Spec.ProviderSpec)
+	config, providerCfg, err := p.getConfig(ctx, log, machine.Spec.ProviderSpec)
 	if err != nil {
 		return nil, fmt.Errorf("failed to get provider config: %w", err)
 	}
 
 	ctx = createReconcileContext(ctx, reconcileContext{
-		Status:       &status,
-		UserData:     userdata,
-		Config:       *config,
-		ProviderData: data,
-		Machine:      machine,
+		Status:         &status,
+		UserData:       userdata,
+		Config:         *config,
+		ProviderData:   data,
+		ProviderConfig: providerCfg,
+		Machine:        machine,
 	})
 
 	_, client, err := getClient(config.Token)
@@ -165,6 +166,19 @@ func provisionVM(ctx context.Context, log *zap.SugaredLogger, client anxclient.C
 
 		vm.Script = base64.StdEncoding.EncodeToString([]byte(reconcileContext.UserData))
 
+		for index, dnsServer := range reconcileContext.ProviderConfig.Network.DNS.Servers {
+			switch index {
+			case 0:
+				vm.DNS1 = dnsServer
+			case 1:
+				vm.DNS2 = dnsServer
+			case 2:
+				vm.DNS3 = dnsServer
+			case 3:
+				vm.DNS4 = dnsServer
+			}
+		}
+
 		// We generate a fresh SSH key but will never actually use it - we just want a valid public key to disable password authentication for our fresh VM.
 		sshKey, err := ssh.NewKey()
 		if err != nil {
diff --git a/pkg/cloudprovider/provider/anexia/reconcile_context.go b/pkg/cloudprovider/provider/anexia/reconcile_context.go
index dea3577c..2a14d872 100644
--- a/pkg/cloudprovider/provider/anexia/reconcile_context.go
+++ b/pkg/cloudprovider/provider/anexia/reconcile_context.go
@@ -22,6 +22,7 @@ import (
 	"github.com/kubermatic/machine-controller/pkg/apis/cluster/v1alpha1"
 	anxtypes "github.com/kubermatic/machine-controller/pkg/cloudprovider/provider/anexia/types"
 	cloudprovidertypes "github.com/kubermatic/machine-controller/pkg/cloudprovider/types"
+	providerconfigtypes "github.com/kubermatic/machine-controller/pkg/providerconfig/types"
 )
 
 type contextKey byte
@@ -29,11 +30,12 @@ type contextKey byte
 const machineReconcileContextKey contextKey = 0
 
 type reconcileContext struct {
-	Machine      *v1alpha1.Machine
-	Status       *anxtypes.ProviderStatus
-	UserData     string
-	Config       resolvedConfig
-	ProviderData *cloudprovidertypes.ProviderData
+	Machine        *v1alpha1.Machine
+	Status         *anxtypes.ProviderStatus
+	UserData       string
+	Config         resolvedConfig
+	ProviderData   *cloudprovidertypes.ProviderData
+	ProviderConfig *providerconfigtypes.Config
 }
 
 func createReconcileContext(ctx context.Context, cc reconcileContext) context.Context {


Test patch:
diff --git a/.prow/e2e-features.yaml b/.prow/e2e-features.yaml
index 769eb361..66551674 100644
--- a/.prow/e2e-features.yaml
+++ b/.prow/e2e-features.yaml
@@ -34,7 +34,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
@@ -63,7 +63,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
@@ -91,7 +91,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
@@ -118,7 +118,7 @@ presubmits:
       preset-kubeconfig-ci: "true"
     spec:
       containers:
-        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-1
+        - image: quay.io/kubermatic/build:go-1.20-node-18-kind-0.18-3
           command:
             - "./hack/ci/run-e2e-tests.sh"
           args:
diff --git a/pkg/cloudprovider/provider/anexia/provider_test.go b/pkg/cloudprovider/provider/anexia/provider_test.go
index 085aa70d..b0faddd7 100644
--- a/pkg/cloudprovider/provider/anexia/provider_test.go
+++ b/pkg/cloudprovider/provider/anexia/provider_test.go
@@ -45,6 +45,7 @@ import (
 	cloudprovidererrors "github.com/kubermatic/machine-controller/pkg/cloudprovider/errors"
 	anxtypes "github.com/kubermatic/machine-controller/pkg/cloudprovider/provider/anexia/types"
 	cloudprovidertypes "github.com/kubermatic/machine-controller/pkg/cloudprovider/types"
+	providerconfigtypes "github.com/kubermatic/machine-controller/pkg/providerconfig/types"
 
 	"k8s.io/apimachinery/pkg/api/meta"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -107,6 +108,11 @@ func TestAnexiaProvider(t *testing.T) {
 			testhelper.AssertEquals(t, expectedJSON["cpu_performance_type"], jsonBody["cpu_performance_type"])
 			testhelper.AssertEquals(t, expectedJSON["hostname"], jsonBody["hostname"])
 			testhelper.AssertEquals(t, expectedJSON["memory_mb"], jsonBody["memory_mb"])
+
+			testhelper.AssertEquals(t, jsonBody["dns1"], "1.1.1.1")
+			testhelper.AssertEquals(t, jsonBody["dns2"], nil)
+			testhelper.AssertEquals(t, jsonBody["dns3"], "192.168.0.1")
+			testhelper.AssertEquals(t, jsonBody["dns4"], "192.168.0.2")
 			testhelper.AssertEquals(t, expectedJSON["count"], jsonBody["count"])
 
 			expectedNetwork := expectedJSON["network"].([]jsonObject)[0]
@@ -165,6 +171,19 @@ func TestAnexiaProvider(t *testing.T) {
 					return nil
 				},
 			},
+			ProviderConfig: &providerconfigtypes.Config{
+				Network: &providerconfigtypes.NetworkConfig{
+					DNS: providerconfigtypes.DNSConfig{
+						Servers: []string{
+							"1.1.1.1",
+							"",
+							"192.168.0.1",
+							"192.168.0.2",
+							"192.168.0.3",
+						},
+					},
+				},
+			},
 		})
 
 		err := provisionVM(ctx, log, client)