0
0
forked from toolshed/abra

feat(secrets): Sort list output

This is usefull for scripting.
This commit is contained in:
2025-08-25 12:54:20 +02:00
parent e92ff6e013
commit c9e293bde2
2 changed files with 11 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import (
"fmt"
"io"
"os"
"sort"
"strconv"
"strings"
@ -435,6 +436,10 @@ var AppSecretLsCommand = &cobra.Command{
log.Fatal(err)
}
// Sort secrets to ensure reproducible output
sort.Slice(secStats, func(i, j int) bool {
return secStats[i].LocalName < secStats[j].LocalName
})
var rows [][]string
for _, secStat := range secStats {
row := []string{

View File

@ -357,6 +357,12 @@ teardown(){
| jq -r ".[] | select(.name==\"test_pass_two\") | .version"'
assert_success
assert_output --partial 'v1'
# Can always expect the secret at this position
run bash -c '$ABRA app secret ls "$TEST_APP_DOMAIN" --machine \
| jq -r ".[1] | .name"'
assert_success
assert_output --partial 'test_pass_two'
}
@test "ls: bail if unstaged changes and no --chaos" {