Skip to content

Commit b54950c

Browse files
authored
fix: order provisioner keys by creation date (#15125)
Closes coder/internal#110 The flake reported in the issue has already been fixed by #14875, but this further covers that we return a list the same order every time.
1 parent 5f640eb commit b54950c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

enterprise/coderd/provisionerkeys.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,5 +212,10 @@ func convertProvisionerKeys(dbKeys []database.ProvisionerKey) []codersdk.Provisi
212212
// HashedSecret - never include the access token in the API response
213213
})
214214
}
215+
216+
slices.SortFunc(keys, func(key1, key2 codersdk.ProvisionerKey) int {
217+
return key1.CreatedAt.Compare(key2.CreatedAt)
218+
})
219+
215220
return keys
216221
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy