Skip to content

Commit ef3b1da

Browse files
committed
[feat aga] Implement endpoints builder filtering for partially loaded endpoints
1 parent 466d823 commit ef3b1da

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

pkg/aga/model_build_endpoint_group.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,3 +337,23 @@ func (b *defaultEndpointGroupBuilder) validatePortOverrides(listener *agamodel.L
337337

338338
return nil
339339
}
340+
341+
// buildEndpointConfiguration creates an EndpointConfiguration from a GlobalAcceleratorEndpoint
342+
// This helper function consolidates the repeated code for creating endpoint configurations
343+
func buildEndpointConfigurationFromEndpoint(endpoint *agaapi.GlobalAcceleratorEndpoint) agamodel.EndpointConfiguration {
344+
endpointConfig := agamodel.EndpointConfiguration{
345+
EndpointID: awssdk.ToString(endpoint.EndpointID),
346+
}
347+
348+
// Add weight if specified
349+
if endpoint.Weight != nil {
350+
endpointConfig.Weight = endpoint.Weight
351+
}
352+
353+
// Add client IP preservation setting if specified
354+
if endpoint.ClientIPPreservationEnabled != nil {
355+
endpointConfig.ClientIPPreservationEnabled = endpoint.ClientIPPreservationEnabled
356+
}
357+
358+
return endpointConfig
359+
}

0 commit comments

Comments
 (0)