Skip to content

Commit cf7de7c

Browse files
committed
chore(ingress): remove debug
1 parent d902d3a commit cf7de7c

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

pkg/ingress/model_build_frontend_nlb.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,6 @@ func (t *defaultModelBuildTask) buildFrontendNlbSubnetMappings(ctx context.Conte
119119
}
120120
}
121121

122-
123-
fmt.Printf("explicitSubnetNameOrIDsList: %+v\n", explicitSubnetNameOrIDsList)
124-
fmt.Printf("eipAllocationsList: %+v\n", eipAllocationsList)
125-
126-
127122
if len(explicitSubnetNameOrIDsList) != 0 {
128123
chosenSubnetNameOrIDs := explicitSubnetNameOrIDsList[0]
129124
for _, subnetNameOrIDs := range explicitSubnetNameOrIDsList[1:] {
@@ -150,23 +145,21 @@ func (t *defaultModelBuildTask) buildFrontendNlbSubnetMappings(ctx context.Conte
150145
return nil, errors.Errorf("all EIP allocations for the ingress group must be the same: %v | %v", chosenEipAllocations, eipAllocations)
151146
}
152147
}
148+
153149
if len(chosenEipAllocations) != len(chosenSubnets) {
154150
return nil, errors.Errorf("count of EIP allocations (%d) and subnets (%d) must match", len(chosenEipAllocations), len(explicitSubnetNameOrIDsList))
155151
}
156152

157153
return buildFrontendNlbSubnetMappingsWithSubnets(chosenSubnets, chosenEipAllocations), nil
158154
}
159155

160-
161156
return buildFrontendNlbSubnetMappingsWithSubnets(chosenSubnets, []string{}), nil
162157
}
163158

164159
return nil, nil
165160

166161
}
167162

168-
// I found a bug in the current implementation where EIP allocations require both subnets AND EIPs to be provided together, but there's an indexing issue in buildFrontendNlbSubnetMappingsWithSubnets.
169-
// The function tries to access eipAllocation[subnetIndex][0] but the data structure is eipAllocation[ingressIndex][eipIndex].
170163
func buildFrontendNlbSubnetMappingsWithSubnets(subnets []ec2types.Subnet, eipAllocation []string) []elbv2model.SubnetMapping {
171164
subnetMappings := make([]elbv2model.SubnetMapping, 0, len(subnets))
172165
for idx, subnet := range subnets {
@@ -177,6 +170,7 @@ func buildFrontendNlbSubnetMappingsWithSubnets(subnets []ec2types.Subnet, eipAll
177170
subnetMappings[idx].AllocationID = awssdk.String(eipAllocation[idx])
178171
}
179172
}
173+
180174
return subnetMappings
181175
}
182176

0 commit comments

Comments
 (0)