diff --git a/bootstrap/kubeadm/main.go b/bootstrap/kubeadm/main.go index d7f9b7249c86..9185fb292d47 100644 --- a/bootstrap/kubeadm/main.go +++ b/bootstrap/kubeadm/main.go @@ -18,6 +18,7 @@ package main import ( "flag" + "math/rand" "net/http" _ "net/http/pprof" "os" @@ -109,6 +110,8 @@ func InitFlags(fs *pflag.FlagSet) { } func main() { + rand.Seed(time.Now().UnixNano()) + InitFlags(pflag.CommandLine) pflag.CommandLine.AddGoFlagSet(flag.CommandLine) pflag.Parse() diff --git a/cmd/example-provider/main.go b/cmd/example-provider/main.go index d6b6a6abc76e..1ba6f2f53513 100644 --- a/cmd/example-provider/main.go +++ b/cmd/example-provider/main.go @@ -18,7 +18,9 @@ package main import ( "flag" + "math/rand" "os" + "time" "k8s.io/client-go/kubernetes/scheme" "k8s.io/klog" @@ -30,6 +32,8 @@ import ( ) func main() { + rand.Seed(time.Now().UnixNano()) + klog.InitFlags(nil) var enableLeaderElection bool flag.BoolVar(&enableLeaderElection, "enable-leader-election", false, diff --git a/controlplane/kubeadm/main.go b/controlplane/kubeadm/main.go index a2a660b8664a..f228adb1e0d7 100644 --- a/controlplane/kubeadm/main.go +++ b/controlplane/kubeadm/main.go @@ -18,6 +18,7 @@ package main import ( "flag" + "math/rand" "net/http" _ "net/http/pprof" "os" @@ -101,6 +102,8 @@ func InitFlags(fs *pflag.FlagSet) { "Webhook Server port, disabled by default. When enabled, the manager will only work as webhook server, no reconcilers are installed.") } func main() { + rand.Seed(time.Now().UnixNano()) + InitFlags(pflag.CommandLine) pflag.CommandLine.AddGoFlagSet(flag.CommandLine) pflag.Parse() diff --git a/main.go b/main.go index 252c0c19d880..d234206c04f5 100644 --- a/main.go +++ b/main.go @@ -17,6 +17,7 @@ package main import ( "flag" + "math/rand" "net/http" _ "net/http/pprof" "os" @@ -131,6 +132,8 @@ func InitFlags(fs *pflag.FlagSet) { } func main() { + rand.Seed(time.Now().UnixNano()) + InitFlags(pflag.CommandLine) pflag.CommandLine.AddGoFlagSet(flag.CommandLine) pflag.Parse() diff --git a/test/infrastructure/docker/main.go b/test/infrastructure/docker/main.go index c9f794f19758..57d71bf7d400 100644 --- a/test/infrastructure/docker/main.go +++ b/test/infrastructure/docker/main.go @@ -18,6 +18,7 @@ package main import ( "flag" + "math/rand" "os" "time" @@ -55,6 +56,8 @@ func init() { } func main() { + rand.Seed(time.Now().UnixNano()) + klog.InitFlags(nil) flag.StringVar(&metricsAddr, "metrics-addr", ":8080", "The address the metric endpoint binds to.") flag.IntVar(&concurrency, "concurrency", 10, "The number of docker machines to process simultaneously")