Skip to content

Commit 95dbf8c

Browse files
committed
Change order of columns in list recommendations
Signed-off-by: Josef Karasek <karasek.jose@gmail.com>
1 parent ddbf180 commit 95dbf8c

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

internal/output/output.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,14 @@ func renderRecommendationListText(recommendations []map[string]any) []byte {
146146

147147
grouped := groupRecommendations(recommendations)
148148
rows := make([][]string, 0, len(grouped)+1)
149-
rows = append(rows, []string{"KIND", "CONTAINER", "NAME", "NAMESPACE", "CPU REQUESTS", "CPU LIMITS", "MEMORY REQUESTS", "MEMORY LIMITS"})
149+
rows = append(rows, []string{"KIND", "NAMESPACE", "NAME", "CONTAINER", "CPU REQUESTS", "CPU LIMITS", "MEMORY REQUESTS", "MEMORY LIMITS"})
150150

151151
for _, recommendation := range grouped {
152152
rows = append(rows, []string{
153153
recommendation.kind,
154-
recommendation.container,
155-
recommendation.name,
156154
recommendation.namespace,
155+
recommendation.name,
156+
recommendation.container,
157157
recommendation.cpuRequests,
158158
recommendation.cpuLimits,
159159
recommendation.memoryRequests,

internal/output/output_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,9 @@ func TestWriteTextRecommendationsListUsesTable(t *testing.T) {
235235
got := out.String()
236236
for _, expected := range []string{
237237
"KIND",
238-
"CONTAINER",
239-
"NAME",
240238
"NAMESPACE",
239+
"NAME",
240+
"CONTAINER",
241241
"CPU REQUESTS",
242242
"CPU LIMITS",
243243
"MEMORY REQUESTS",
@@ -289,9 +289,9 @@ func TestWriteTextRecommendationsFromSampleFileUsesTable(t *testing.T) {
289289
got := out.String()
290290
for _, expected := range []string{
291291
"KIND",
292-
"CONTAINER",
293-
"NAME",
294292
"NAMESPACE",
293+
"NAME",
294+
"CONTAINER",
295295
"CPU REQUESTS",
296296
"CPU LIMITS",
297297
"MEMORY REQUESTS",
@@ -321,7 +321,7 @@ func TestWriteTextRecommendationsFromSampleFileUsesTable(t *testing.T) {
321321
if !strings.Contains(got, "NAME") || !strings.Contains(got, "CONTAINER") || !strings.Contains(got, "MEMORY LIMITS") {
322322
t.Fatalf("missing recommendation headers in output %q", got)
323323
}
324-
if !strings.Contains(got, "Deployment manager") {
324+
if !strings.Contains(got, "Deployment keda kedify-agent manager") {
325325
t.Fatalf("expected workload container column in output %q", got)
326326
}
327327
}

0 commit comments

Comments
 (0)