From 8e0a7e2819c48a646b9d2f226072152c6410c47c Mon Sep 17 00:00:00 2001 From: Pierre PIRONIN Date: Thu, 25 May 2023 16:49:24 +0200 Subject: [PATCH] Fix a bug in ACT_main json patch for Azure Cluster Class Fix a go template bug which makes invalid the template rendering for the AzureClusterTemplate to inject mulitple VNET cidrs. Here is the capi-controller error log message without this fix: E0525 14:28:24.579774 1 controller.go:326] "Reconciler error" err="error reconciling the Cluster topology: failed to create AzureCluster.infrastructure.cluster.x-k8s.io: FieldValueInvalid: spec.networkSpec.cidrBlocks: Invalid value: \"10.221.98.192/27- 10.221.98.224/27\": invalid CIDR format FieldValueInvalid: spec.networkSpec.subnets[0].cidrBlocks: Invalid value: \"10.221.98.192/27\": subnet CIDR not in vnet address space: [10.221.98.192/27- 10.221.98.224/27] FieldValueInvalid: spec.networkSpec.subnets[1].cidrBlocks: Invalid value: \"10.221.98.224/27\": subnet CIDR not in vnet address space: [10.221.98.192/27- 10.221.98.224/27]" controller="topology/cluster" controllerGroup="cluster.x-k8s.io" controllerKind="Cluster" cluster="k8s-mma/k8s-mma" namespace="k8s-mma" name="k8s-mma" reconcileID=eea64084-273f-4028-9b70-374514886761 --- providers/infrastructure-azure/v1.6.3/cconly/base.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/infrastructure-azure/v1.6.3/cconly/base.yaml b/providers/infrastructure-azure/v1.6.3/cconly/base.yaml index e48986dc4a..848a3f52c9 100644 --- a/providers/infrastructure-azure/v1.6.3/cconly/base.yaml +++ b/providers/infrastructure-azure/v1.6.3/cconly/base.yaml @@ -759,7 +759,7 @@ spec: name: {{ if .network.vnet.name }} {{- .network.vnet.name }} {{- else }} {{- .builtin.cluster.name -}} -vnet {{- end }} resourceGroup: {{ if .network.vnet.resourceGroup }} {{- .network.vnet.resourceGroup }} {{- else if .resourceGroup }} {{- .resourceGroup }} {{- else }} {{- .builtin.cluster.name }} {{- end }} cidrBlocks: - {{ range .network.vnet.cidrBlocks -}} + {{ range .network.vnet.cidrBlocks }} - {{ . }} {{- end }} - op: add