Skip to content

Commit e3f6c13

Browse files
authored
sort by key, description, and type (#467)
* sort by key and description * cl * new version * sort by type as well
1 parent 24c5351 commit e3f6c13

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
changelog:
2+
- type: NON_USER_FACING
3+
issueLink: https://github.com/solo-io/gloo-mesh-enterprise/issues/10495
4+
description: >
5+
Sort helm values by description if keys are the same.

codegen/model/chart.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,13 @@ func (c Chart) GenerateHelmDoc() string {
251251

252252
// alphabetize all values
253253
sort.Slice(helmValuesForDoc, func(i, j int) bool {
254-
return helmValuesForDoc[i].Key < helmValuesForDoc[j].Key
254+
if helmValuesForDoc[i].Key != helmValuesForDoc[j].Key {
255+
return helmValuesForDoc[i].Key < helmValuesForDoc[j].Key
256+
}
257+
if helmValuesForDoc[i].Description != helmValuesForDoc[j].Description {
258+
return helmValuesForDoc[i].Description < helmValuesForDoc[j].Description
259+
}
260+
return helmValuesForDoc[i].Type < helmValuesForDoc[j].Type
255261
})
256262

257263
return helmValuesForDoc.ToMarkdown(c.ValuesReferenceDocs.Title)

0 commit comments

Comments
 (0)