Skip to content

Commit

Permalink
refactor(main): when generating resources, sort the data of the endpo…
Browse files Browse the repository at this point in the history
…int. (#141)

Signed-off-by: cuisongliu <cuisongliu@qq.com>
  • Loading branch information
cuisongliu authored Nov 14, 2023
1 parent b062f0f commit ef9074c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/cepctl/app/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"fmt"
client2 "github.com/labring/endpoints-operator/utils/client"
"os"
"sort"

"github.com/labring/endpoints-operator/apis/network/v1beta1"
"github.com/labring/endpoints-operator/cmd/cepctl/app/options"
Expand Down Expand Up @@ -112,7 +113,7 @@ func run(s *options.Options, ctx context.Context) error {
for _, addr := range subset.Addresses {
ips = append(ips, addr.IP)
}

sort.Sort(sort.StringSlice(ips))
for _, port := range subset.Ports {
ports = append(ports, v1beta1.ServicePort{
Handler: v1beta1.Handler{
Expand Down

0 comments on commit ef9074c

Please sign in to comment.