From 8bbda7202247f65cdec07b1523a33d1ae794a85e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=A3rebe=20-=20Romain=20GERARD?= Date: Fri, 29 Dec 2023 11:42:49 +0100 Subject: [PATCH] chore(list-pods): Sort ports --- cmd/service_list_pods.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/service_list_pods.go b/cmd/service_list_pods.go index 81bd4428..7a75a192 100644 --- a/cmd/service_list_pods.go +++ b/cmd/service_list_pods.go @@ -4,6 +4,7 @@ import ( "github.com/qovery/qovery-cli/pkg" "github.com/qovery/qovery-cli/utils" "github.com/spf13/cobra" + "sort" "strconv" "strings" ) @@ -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)