Skip to content

Commit

Permalink
Sort Helm Revisions (#589)
Browse files Browse the repository at this point in the history
Instead of directly returning the revisions of a Helm chart, we are now
sorting the revisions by the version field.
  • Loading branch information
ricoberger committed Apr 12, 2024
1 parent 2f783c4 commit 4f4850b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/kubenav/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,10 @@ func HelmGetHistory(clusterServer, clusterCertificateAuthorityData string, clust
releases = append(releases, release)
}

sort.Slice(releases, func(i, j int) bool {
return releases[i].Version < releases[j].Version
})

releasesBytes, err := json.Marshal(releases)
if err != nil {
return "", err
Expand Down

0 comments on commit 4f4850b

Please sign in to comment.