Skip to content

Commit

Permalink
chore(list-pods): Sort ports
Browse files Browse the repository at this point in the history
  • Loading branch information
erebe committed Dec 29, 2023
1 parent 545eb61 commit 8bbda72
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/service_list_pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"github.com/qovery/qovery-cli/pkg"
"github.com/qovery/qovery-cli/utils"
"github.com/spf13/cobra"
"sort"
"strconv"
"strings"
)
Expand Down Expand Up @@ -34,6 +35,7 @@ var serviceListPods = &cobra.Command{

var data [][]string
for _, pod := range pods.Pods {
sort.Slice(pod.Ports, func(i, j int) bool { return pod.Ports[i] < pod.Ports[j] })
ports := make([]string, len(pod.Ports))
for i, x := range pod.Ports {
ports[i] = strconv.FormatUint(uint64(x), 10)
Expand Down

0 comments on commit 8bbda72

Please sign in to comment.