Skip to content

Commit

Permalink
cmd: seed random number generator
Browse files Browse the repository at this point in the history
  • Loading branch information
sttts committed Jan 27, 2023
1 parent 1da2755 commit e0cf0fc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/cache-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ package main

import (
"flag"
"math/rand"
"os"
"strings"
"time"

"github.com/spf13/cobra"

Expand All @@ -34,6 +36,8 @@ import (
)

func main() {
rand.Seed(time.Now().UTC().UnixNano())

rootDir := flag.String("root-directory", ".kcp-cache", "Path to the root directory where all files required by this server will be stored")

var cacheServerFlags, remainingFlags []string //nolint:prealloc
Expand Down
4 changes: 4 additions & 0 deletions cmd/kcp/kcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ package main

import (
"fmt"
"math/rand"
"os"
"strings"
"time"

"github.com/spf13/cobra"

Expand All @@ -44,6 +46,8 @@ import (
)

func main() {
rand.Seed(time.Now().UTC().UnixNano())

cmd := &cobra.Command{
Use: "kcp",
Short: "Kube for Control Plane (KCP)",
Expand Down
4 changes: 4 additions & 0 deletions cmd/syncer/cmd/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ package cmd
import (
"context"
"errors"
"math/rand"
"os"
"time"

"github.com/kcp-dev/logicalcluster/v3"
"github.com/spf13/cobra"
Expand All @@ -38,6 +40,8 @@ import (
const numThreads = 2

func NewSyncerCommand() *cobra.Command {
rand.Seed(time.Now().UTC().UnixNano())

options := synceroptions.NewOptions()
syncerCommand := &cobra.Command{
Use: "syncer",
Expand Down

0 comments on commit e0cf0fc

Please sign in to comment.