mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
test: Fix generated workspace name length (#7228)
This commit is contained in:
committed by
GitHub
parent
d8eda97dbe
commit
ad0070354f
@ -1069,7 +1069,12 @@ func NewAzureInstanceIdentity(t *testing.T, instanceID string) (x509.VerifyOptio
|
||||
func randomUsername(t testing.TB) string {
|
||||
suffix, err := cryptorand.String(3)
|
||||
require.NoError(t, err)
|
||||
return strings.ReplaceAll(namesgenerator.GetRandomName(10), "_", "-") + "-" + suffix
|
||||
suffix = "-" + suffix
|
||||
n := strings.ReplaceAll(namesgenerator.GetRandomName(10), "_", "-") + suffix
|
||||
if len(n) > 32 {
|
||||
n = n[:32-len(suffix)] + suffix
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
// Used to easily create an HTTP transport!
|
||||
|
Reference in New Issue
Block a user