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.

Signed-off-by: cuisongliu <[email protected]>
  • Loading branch information
cuisongliu committed Nov 14, 2023
1 parent 48588d2 commit 6a2a4df
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 6a2a4df

Please sign in to comment.