mirror of
https://github.com/k3s-io/k3s.git
synced 2026-02-03 20:39:49 -05:00
Drop calls to rand.Seed
The rng has been automatically seeded since go1.20, and explicitly seeding it has been a no-op since go1.24. Ref: https://go.dev/doc/godebug#go-120 and https://go.dev/doc/godebug#go-124 Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
parent
3190f30de8
commit
89adabb672
3 changed files with 0 additions and 9 deletions
|
|
@ -3,7 +3,6 @@ package agent
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"net"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
|
@ -35,7 +34,6 @@ import (
|
|||
)
|
||||
|
||||
func Agent(ctx context.Context, nodeConfig *daemonconfig.Node, proxy proxy.Proxy) error {
|
||||
rand.Seed(time.Now().UTC().UnixNano())
|
||||
logsapi.ReapplyHandling = logsapi.ReapplyHandlingIgnoreUnchanged
|
||||
logs.InitLogs()
|
||||
defer logs.FlushLogs()
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package control
|
|||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"math/rand"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
|
|
@ -42,8 +41,6 @@ import (
|
|||
// Prepare loads bootstrap data from the datastore and sets up the initial
|
||||
// tunnel server request handler and stub authenticator.
|
||||
func Prepare(ctx context.Context, wg *sync.WaitGroup, cfg *config.Control) error {
|
||||
rand.Seed(time.Now().UTC().UnixNano())
|
||||
|
||||
logsapi.ReapplyHandling = logsapi.ReapplyHandlingIgnoreUnchanged
|
||||
if err := prepare(ctx, wg, cfg); err != nil {
|
||||
return pkgerrors.WithMessage(err, "preparing server")
|
||||
|
|
|
|||
|
|
@ -2,11 +2,9 @@ package kubectl
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"os"
|
||||
"runtime"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/k3s-io/k3s/pkg/server"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
|
@ -44,8 +42,6 @@ func Main() {
|
|||
}
|
||||
|
||||
func main() {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
|
||||
command := cmd.NewDefaultKubectlCommand()
|
||||
if err := cli.RunNoErrOutput(command); err != nil {
|
||||
util.CheckErr(err)
|
||||
|
|
|
|||
Loading…
Reference in a new issue