mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
fix: order provisioner keys by creation date (#15125)
Closes https://github.com/coder/internal/issues/110 The flake reported in the issue has already been fixed by https://github.com/coder/coder/pull/14875, but this further covers that we return a list the same order every time.
This commit is contained in:
@ -212,5 +212,10 @@ func convertProvisionerKeys(dbKeys []database.ProvisionerKey) []codersdk.Provisi
|
||||
// HashedSecret - never include the access token in the API response
|
||||
})
|
||||
}
|
||||
|
||||
slices.SortFunc(keys, func(key1, key2 codersdk.ProvisionerKey) int {
|
||||
return key1.CreatedAt.Compare(key2.CreatedAt)
|
||||
})
|
||||
|
||||
return keys
|
||||
}
|
||||
|
Reference in New Issue
Block a user