Skip to content

Commit

Permalink
fix(compute/setup): fix duplicated domains (#808)
Browse files Browse the repository at this point in the history
  • Loading branch information
Integralist authored Feb 9, 2023
1 parent 2ef4c87 commit af3d77d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/commands/compute/setup/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 (
Expand Down

0 comments on commit af3d77d

Please sign in to comment.