Merge pull request #13362 from srikiz/DO-Fix-RandomZones

[Digital Ocean] e2e tests - Fix seeding for generating random zones
This commit is contained in:
Kubernetes Prow Robot 2022-03-15 08:24:10 -07:00 committed by GitHub
commit 061d84de24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -19,6 +19,7 @@ package do
import (
"errors"
"math/rand"
"time"
)
var allZones = []string{
@ -46,7 +47,8 @@ func RandomZones(count int) ([]string, error) {
return nil, ErrMoreThanOneZone
}
n := rand.Int() % len(allZones)
rand.Seed(time.Now().UnixNano())
n := rand.Intn(1000) % len(allZones)
chosenZone := allZones[n]
chosenZones := make([]string, 0)