From 8adb5344652203751d0729e4ffd79841fd137a32 Mon Sep 17 00:00:00 2001 From: Mario Nitchev Date: Mon, 8 Apr 2024 11:16:54 +0300 Subject: [PATCH] give name to secondary subnets --- pkg/cloud/services/network/subnets.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/cloud/services/network/subnets.go b/pkg/cloud/services/network/subnets.go index 84766c4289..e707b24090 100644 --- a/pkg/cloud/services/network/subnets.go +++ b/pkg/cloud/services/network/subnets.go @@ -28,6 +28,8 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/pkg/errors" + "sigs.k8s.io/cluster-api/util/conditions" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" "sigs.k8s.io/cluster-api-provider-aws/v2/pkg/cloud/awserrors" "sigs.k8s.io/cluster-api-provider-aws/v2/pkg/cloud/converters" @@ -37,7 +39,6 @@ import ( "sigs.k8s.io/cluster-api-provider-aws/v2/pkg/cloud/tags" "sigs.k8s.io/cluster-api-provider-aws/v2/pkg/internal/cidr" "sigs.k8s.io/cluster-api-provider-aws/v2/pkg/record" - "sigs.k8s.io/cluster-api/util/conditions" ) const ( @@ -115,6 +116,7 @@ func (s *Service) reconcileSubnets() error { for i, sub := range subnetCIDRs { secondarySub := infrav1.SubnetSpec{ + ID: fmt.Sprintf("%s-subnet-%s-%s", s.scope.Name(), infrav1.SecondarySubnetTagValue, zones[i]), CidrBlock: sub.String(), AvailabilityZone: zones[i], IsPublic: false,