Skip to content

Commit

Permalink
fix(kuma-cp): sort external-services when building vips
Browse files Browse the repository at this point in the history
Signed-off-by: Lukasz Dziedziak <lukidzi@gmail.com>
  • Loading branch information
lukidzi committed Jul 24, 2023
1 parent 8cd2da4 commit d064bc0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/dns/vips_allocator.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"net"
"sort"
"strings"

"github.com/pkg/errors"
Expand Down Expand Up @@ -226,6 +227,10 @@ func (d *VIPsAllocator) BuildVirtualOutboundMeshView(ctx context.Context, mesh s
if err := d.rm.List(ctx, &externalServices, store.ListByMesh(mesh)); err != nil {
return nil, err
}
sort.SliceStable(externalServices.Items, func(i, j int) bool {
return (externalServices.Items[i].GetMeta().GetName() < externalServices.Items[j].GetMeta().GetName())
})

for _, es := range externalServices.Items {
tags := map[string]string{mesh_proto.ServiceTag: es.Spec.GetService()}
if d.serviceVipEnabled {
Expand Down

0 comments on commit d064bc0

Please sign in to comment.