Skip to content

Commit 2cf25eb

Browse files
authored
Merge pull request #5474 from giantswarm/dont-overwrite-subnet-tags
🐛 Don't overwrite subnet spec tags with AWS tags
2 parents ef9d03a + bd953e3 commit 2cf25eb

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

pkg/cloud/services/network/subnets.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ func (s *Service) reconcileSubnets() error {
133133

134134
// Update subnet spec with the existing subnet details
135135
existingSubnet.DeepCopyInto(sub)
136+
sub.Tags = subnetTags
136137

137138
if err := wait.WaitForWithRetryable(wait.NewBackoff(), func() (bool, error) {
138139
buildParams := s.getSubnetTagParams(unmanagedVPC, existingSubnet.GetResourceID(), existingSubnet.IsPublic, existingSubnet.AvailabilityZone, subnetTags, existingSubnet.IsEdge())

pkg/cloud/services/network/subnets_test.go

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,6 @@ func TestReconcileSubnets(t *testing.T) {
676676
AvailabilityZone: "us-east-1a",
677677
CidrBlock: "10.0.10.0/24",
678678
IsPublic: true,
679-
Tags: infrav1.Tags{},
680679
},
681680
},
682681
expect: func(m *mocks.MockEC2APIMockRecorder) {
@@ -782,15 +781,13 @@ func TestReconcileSubnets(t *testing.T) {
782781
AvailabilityZone: "us-east-1a",
783782
CidrBlock: "10.0.10.0/24",
784783
IsPublic: true,
785-
Tags: infrav1.Tags{},
786784
},
787785
{
788786
ID: "subnet-2",
789787
ResourceID: "subnet-2",
790788
AvailabilityZone: "us-east-1b",
791789
CidrBlock: "10.0.11.0/24",
792790
IsPublic: true,
793-
Tags: infrav1.Tags{},
794791
},
795792
},
796793
expect: func(m *mocks.MockEC2APIMockRecorder) {
@@ -4144,10 +4141,7 @@ func TestDiscoverSubnets(t *testing.T) {
41444141
CidrBlock: "10.0.10.0/24",
41454142
IsPublic: true,
41464143
RouteTableID: aws.String("rtb-1"),
4147-
Tags: infrav1.Tags{
4148-
"Name": "provided-subnet-public",
4149-
},
4150-
ZoneType: ptr.To[infrav1.ZoneType]("availability-zone"),
4144+
ZoneType: ptr.To[infrav1.ZoneType]("availability-zone"),
41514145
},
41524146
{
41534147
ID: "subnet-2",
@@ -4156,10 +4150,7 @@ func TestDiscoverSubnets(t *testing.T) {
41564150
CidrBlock: "10.0.11.0/24",
41574151
IsPublic: false,
41584152
RouteTableID: aws.String("rtb-2"),
4159-
Tags: infrav1.Tags{
4160-
"Name": "provided-subnet-private",
4161-
},
4162-
ZoneType: ptr.To[infrav1.ZoneType]("availability-zone"),
4153+
ZoneType: ptr.To[infrav1.ZoneType]("availability-zone"),
41634154
},
41644155
},
41654156
},

0 commit comments

Comments
 (0)