Skip to content

Commit

Permalink
give name to secondary subnets
Browse files Browse the repository at this point in the history
  • Loading branch information
mnitchev committed Apr 8, 2024
1 parent e9c5ab6 commit 8adb534
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/cloud/services/network/subnets.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 (
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 8adb534

Please sign in to comment.