Skip to content

Commit

Permalink
Minor improvements for envoy snapshot mapper (#63)
Browse files Browse the repository at this point in the history
Signed-off-by: Waleed Malik <[email protected]>
  • Loading branch information
ahmedwaleedmalik authored Sep 11, 2024
1 parent 70c5280 commit ddc5bb7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/envoy/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ func MapSnapshot(ctx context.Context, client ctrlclient.Client, loadBalancers []
for i, lbEndpoint := range lb.Spec.Endpoints {
if lbEndpoint.AddressesReference != nil {
// Check if map already contains the key
if val, ok := addressesMap[fmt.Sprintf(endpointAddressReferencePattern, lb.Namespace, lbEndpoint.AddressesReference.Name)]; ok && len(loadBalancers) == 1 {
if val, ok := addressesMap[fmt.Sprintf(endpointAddressReferencePattern, lb.Namespace, lbEndpoint.AddressesReference.Name)]; ok {
lb.Spec.Endpoints[i].Addresses = val
lbEndpoint.Addresses = val
} else {
// Load addresses from reference
var addresses kubelbv1alpha1.Addresses
Expand Down

0 comments on commit ddc5bb7

Please sign in to comment.