vmware-tanzu / tanzu-framework

Tanzu Framework provides a set of building blocks to build atop of the Tanzu platform and leverages Carvel packaging and plugins to provide users with a much stronger, more integrated experience than the loose coupling and stand-alone commands of the previous generation of tools.
Apache License 2.0
195 stars 192 forks source link

'ACT_main' json patch fails with multiple VNET cidr blocks #4621

Open PierrePIRONIN opened 1 year ago

PierrePIRONIN commented 1 year ago

Bug description Using the Azure Cluster Class to deploy an Azure Kubernetes cluster, the 'ACT_main' json patch fails when multiple VNET cidr blocks are provided. This is due to a go templating typo, hyphen that should not be present at the end of a range loop on network.vnet.cidrBlocks (see PR I’ve opened to fix it).

Affected product area (please put an X in all that apply)

Expected behavior Valid template rendering when multiple VNET cidr blocks are provided.

Steps to reproduce the bug Try to build an Azure Kubernetes cluster with multiple VNET cidr blocks.

Version (include the SHA if the version is not obvious) At least TKG 2.2.0 and TKG 2.1.1 which were the ones I’ve tested.

Environment where the bug was observed (cloud, OS, etc) Azure

Relevant Debug Output (Logs, manifests, etc) Logs extracted from capi-controller :

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

github-actions[bot] commented 1 year ago

Hey @PierrePIRONIN! Thanks for opening your first issue. We appreciate your contribution and welcome you to our community! We are glad to have you here and to have your input on Tanzu Framework.