From af3d77d3411e8075d1cc9c519018fea593fb1f4a Mon Sep 17 00:00:00 2001 From: Mark McDonnell Date: Thu, 9 Feb 2023 10:24:48 +0000 Subject: [PATCH] fix(compute/setup): fix duplicated domains (#808) --- pkg/commands/compute/setup/domain.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/commands/compute/setup/domain.go b/pkg/commands/compute/setup/domain.go index 4644a0fb7..13d5a0ee2 100644 --- a/pkg/commands/compute/setup/domain.go +++ b/pkg/commands/compute/setup/domain.go @@ -3,7 +3,9 @@ package setup import ( "fmt" "io" + "math/rand" "regexp" + "time" petname "github.com/dustinkirkland/golang-petname" "github.com/fastly/cli/pkg/api" @@ -55,6 +57,10 @@ func (d *Domains) Configure() error { return nil } + // IMPORTANT: go1.20 deprecates rand.Seed + // The global random number generator (RNG) is now automatically seeded. + // If not seeded, the same domain name is repeated on each run. + rand.Seed(time.Now().UnixNano()) defaultDomain := fmt.Sprintf("%s.%s", petname.Generate(3, "-"), defaultTopLevelDomain) var (