Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
3a243090
Unverified
Commit
3a243090
authored
Oct 11, 2018
by
Mikhail Mazurskiy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify random seed initialization
There is no need to set the time zone as the result does not depend on it
parent
effd009d
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
17 additions
and
17 deletions
+17
-17
controller-manager.go
cmd/cloud-controller-manager/controller-manager.go
+1
-1
main.go
cmd/hyperkube/main.go
+1
-1
apiserver.go
cmd/kube-apiserver/apiserver.go
+1
-1
controller-manager.go
cmd/kube-controller-manager/controller-manager.go
+1
-1
proxy.go
cmd/kube-proxy/proxy.go
+1
-1
scheduler.go
cmd/kube-scheduler/scheduler.go
+1
-1
kubectl.go
cmd/kubectl/kubectl.go
+1
-1
server.go
cmd/kubelet/app/server.go
+1
-1
kubelet.go
cmd/kubelet/kubelet.go
+1
-1
hollow-node.go
cmd/kubemark/hollow-node.go
+1
-1
controller.go
pkg/kubemark/controller.go
+1
-1
flocker_util.go
pkg/volume/flocker/flocker_util.go
+1
-1
rand.go
staging/src/k8s.io/apimachinery/pkg/util/rand/rand.go
+1
-1
service.go
test/e2e/network/service.go
+1
-1
pd.go
test/e2e/storage/pd.go
+1
-1
e2e_node_suite_test.go
test/e2e_node/e2e_node_suite_test.go
+1
-1
run_remote.go
test/e2e_node/runner/remote/run_remote.go
+1
-1
No files found.
cmd/cloud-controller-manager/controller-manager.go
View file @
3a243090
...
@@ -39,7 +39,7 @@ import (
...
@@ -39,7 +39,7 @@ import (
)
)
func
main
()
{
func
main
()
{
rand
.
Seed
(
time
.
Now
()
.
U
TC
()
.
U
nixNano
())
rand
.
Seed
(
time
.
Now
()
.
UnixNano
())
command
:=
app
.
NewCloudControllerManagerCommand
()
command
:=
app
.
NewCloudControllerManagerCommand
()
...
...
cmd/hyperkube/main.go
View file @
3a243090
...
@@ -47,7 +47,7 @@ import (
...
@@ -47,7 +47,7 @@ import (
)
)
func
main
()
{
func
main
()
{
rand
.
Seed
(
time
.
Now
()
.
U
TC
()
.
U
nixNano
())
rand
.
Seed
(
time
.
Now
()
.
UnixNano
())
hyperkubeCommand
,
allCommandFns
:=
NewHyperKubeCommand
(
server
.
SetupSignalHandler
())
hyperkubeCommand
,
allCommandFns
:=
NewHyperKubeCommand
(
server
.
SetupSignalHandler
())
...
...
cmd/kube-apiserver/apiserver.go
View file @
3a243090
...
@@ -36,7 +36,7 @@ import (
...
@@ -36,7 +36,7 @@ import (
)
)
func
main
()
{
func
main
()
{
rand
.
Seed
(
time
.
Now
()
.
U
TC
()
.
U
nixNano
())
rand
.
Seed
(
time
.
Now
()
.
UnixNano
())
command
:=
app
.
NewAPIServerCommand
(
server
.
SetupSignalHandler
())
command
:=
app
.
NewAPIServerCommand
(
server
.
SetupSignalHandler
())
...
...
cmd/kube-controller-manager/controller-manager.go
View file @
3a243090
...
@@ -39,7 +39,7 @@ import (
...
@@ -39,7 +39,7 @@ import (
)
)
func
main
()
{
func
main
()
{
rand
.
Seed
(
time
.
Now
()
.
U
TC
()
.
U
nixNano
())
rand
.
Seed
(
time
.
Now
()
.
UnixNano
())
command
:=
app
.
NewControllerManagerCommand
()
command
:=
app
.
NewControllerManagerCommand
()
...
...
cmd/kube-proxy/proxy.go
View file @
3a243090
...
@@ -33,7 +33,7 @@ import (
...
@@ -33,7 +33,7 @@ import (
)
)
func
main
()
{
func
main
()
{
rand
.
Seed
(
time
.
Now
()
.
U
TC
()
.
U
nixNano
())
rand
.
Seed
(
time
.
Now
()
.
UnixNano
())
command
:=
app
.
NewProxyCommand
()
command
:=
app
.
NewProxyCommand
()
...
...
cmd/kube-scheduler/scheduler.go
View file @
3a243090
...
@@ -32,7 +32,7 @@ import (
...
@@ -32,7 +32,7 @@ import (
)
)
func
main
()
{
func
main
()
{
rand
.
Seed
(
time
.
Now
()
.
U
TC
()
.
U
nixNano
())
rand
.
Seed
(
time
.
Now
()
.
UnixNano
())
command
:=
app
.
NewSchedulerCommand
()
command
:=
app
.
NewSchedulerCommand
()
...
...
cmd/kubectl/kubectl.go
View file @
3a243090
...
@@ -34,7 +34,7 @@ import (
...
@@ -34,7 +34,7 @@ import (
)
)
func
main
()
{
func
main
()
{
rand
.
Seed
(
time
.
Now
()
.
U
TC
()
.
U
nixNano
())
rand
.
Seed
(
time
.
Now
()
.
UnixNano
())
command
:=
cmd
.
NewDefaultKubectlCommand
()
command
:=
cmd
.
NewDefaultKubectlCommand
()
...
...
cmd/kubelet/app/server.go
View file @
3a243090
...
@@ -732,7 +732,7 @@ func run(s *options.KubeletServer, kubeDeps *kubelet.Dependencies, stopCh <-chan
...
@@ -732,7 +732,7 @@ func run(s *options.KubeletServer, kubeDeps *kubelet.Dependencies, stopCh <-chan
utilruntime
.
ReallyCrash
=
s
.
ReallyCrashForTesting
utilruntime
.
ReallyCrash
=
s
.
ReallyCrashForTesting
rand
.
Seed
(
time
.
Now
()
.
U
TC
()
.
U
nixNano
())
rand
.
Seed
(
time
.
Now
()
.
UnixNano
())
// TODO(vmarmol): Do this through container config.
// TODO(vmarmol): Do this through container config.
oomAdjuster
:=
kubeDeps
.
OOMAdjuster
oomAdjuster
:=
kubeDeps
.
OOMAdjuster
...
...
cmd/kubelet/kubelet.go
View file @
3a243090
...
@@ -34,7 +34,7 @@ import (
...
@@ -34,7 +34,7 @@ import (
)
)
func
main
()
{
func
main
()
{
rand
.
Seed
(
time
.
Now
()
.
U
TC
()
.
U
nixNano
())
rand
.
Seed
(
time
.
Now
()
.
UnixNano
())
command
:=
app
.
NewKubeletCommand
(
server
.
SetupSignalHandler
())
command
:=
app
.
NewKubeletCommand
(
server
.
SetupSignalHandler
())
logs
.
InitLogs
()
logs
.
InitLogs
()
...
...
cmd/kubemark/hollow-node.go
View file @
3a243090
...
@@ -100,7 +100,7 @@ func (c *HollowNodeConfig) createClientConfigFromFile() (*restclient.Config, err
...
@@ -100,7 +100,7 @@ func (c *HollowNodeConfig) createClientConfigFromFile() (*restclient.Config, err
}
}
func
main
()
{
func
main
()
{
rand
.
Seed
(
time
.
Now
()
.
U
TC
()
.
U
nixNano
())
rand
.
Seed
(
time
.
Now
()
.
UnixNano
())
command
:=
newHollowNodeCommand
()
command
:=
newHollowNodeCommand
()
...
...
pkg/kubemark/controller.go
View file @
3a243090
...
@@ -99,7 +99,7 @@ func NewKubemarkController(externalClient kubeclient.Interface, externalInformer
...
@@ -99,7 +99,7 @@ func NewKubemarkController(externalClient kubeclient.Interface, externalInformer
nodesToDelete
:
make
(
map
[
string
]
bool
),
nodesToDelete
:
make
(
map
[
string
]
bool
),
nodesToDeleteLock
:
sync
.
Mutex
{},
nodesToDeleteLock
:
sync
.
Mutex
{},
},
},
rand
:
rand
.
New
(
rand
.
NewSource
(
time
.
Now
()
.
U
TC
()
.
U
nixNano
())),
rand
:
rand
.
New
(
rand
.
NewSource
(
time
.
Now
()
.
UnixNano
())),
createNodeQueue
:
make
(
chan
string
,
1000
),
createNodeQueue
:
make
(
chan
string
,
1000
),
nodeGroupQueueSize
:
make
(
map
[
string
]
int
),
nodeGroupQueueSize
:
make
(
map
[
string
]
int
),
nodeGroupQueueSizeLock
:
sync
.
Mutex
{},
nodeGroupQueueSizeLock
:
sync
.
Mutex
{},
...
...
pkg/volume/flocker/flocker_util.go
View file @
3a243090
...
@@ -68,7 +68,7 @@ func (util *FlockerUtil) CreateVolume(c *flockerVolumeProvisioner) (datasetUUID
...
@@ -68,7 +68,7 @@ func (util *FlockerUtil) CreateVolume(c *flockerVolumeProvisioner) (datasetUUID
}
}
// select random node
// select random node
rand
.
Seed
(
time
.
Now
()
.
U
TC
()
.
U
nixNano
())
rand
.
Seed
(
time
.
Now
()
.
UnixNano
())
node
:=
nodes
[
rand
.
Intn
(
len
(
nodes
))]
node
:=
nodes
[
rand
.
Intn
(
len
(
nodes
))]
glog
.
V
(
2
)
.
Infof
(
"selected flocker node with UUID '%s' to provision dataset"
,
node
.
UUID
)
glog
.
V
(
2
)
.
Infof
(
"selected flocker node with UUID '%s' to provision dataset"
,
node
.
UUID
)
...
...
staging/src/k8s.io/apimachinery/pkg/util/rand/rand.go
View file @
3a243090
...
@@ -27,7 +27,7 @@ var rng = struct {
...
@@ -27,7 +27,7 @@ var rng = struct {
sync
.
Mutex
sync
.
Mutex
rand
*
rand
.
Rand
rand
*
rand
.
Rand
}{
}{
rand
:
rand
.
New
(
rand
.
NewSource
(
time
.
Now
()
.
U
TC
()
.
U
nixNano
())),
rand
:
rand
.
New
(
rand
.
NewSource
(
time
.
Now
()
.
UnixNano
())),
}
}
// Intn generates an integer in range [0,max).
// Intn generates an integer in range [0,max).
...
...
test/e2e/network/service.go
View file @
3a243090
...
@@ -1111,7 +1111,7 @@ var _ = SIGDescribe("Services", func() {
...
@@ -1111,7 +1111,7 @@ var _ = SIGDescribe("Services", func() {
}
}
outOfRangeNodePort
:=
0
outOfRangeNodePort
:=
0
rand
.
Seed
(
time
.
Now
()
.
U
TC
()
.
U
nixNano
())
rand
.
Seed
(
time
.
Now
()
.
UnixNano
())
for
{
for
{
outOfRangeNodePort
=
1
+
rand
.
Intn
(
65535
)
outOfRangeNodePort
=
1
+
rand
.
Intn
(
65535
)
if
!
framework
.
ServiceNodePortRange
.
Contains
(
outOfRangeNodePort
)
{
if
!
framework
.
ServiceNodePortRange
.
Contains
(
outOfRangeNodePort
)
{
...
...
test/e2e/storage/pd.go
View file @
3a243090
...
@@ -79,7 +79,7 @@ var _ = utils.SIGDescribe("Pod Disks", func() {
...
@@ -79,7 +79,7 @@ var _ = utils.SIGDescribe("Pod Disks", func() {
host0Name
=
types
.
NodeName
(
nodes
.
Items
[
0
]
.
ObjectMeta
.
Name
)
host0Name
=
types
.
NodeName
(
nodes
.
Items
[
0
]
.
ObjectMeta
.
Name
)
host1Name
=
types
.
NodeName
(
nodes
.
Items
[
1
]
.
ObjectMeta
.
Name
)
host1Name
=
types
.
NodeName
(
nodes
.
Items
[
1
]
.
ObjectMeta
.
Name
)
mathrand
.
Seed
(
time
.
Now
()
.
U
TC
()
.
U
nixNano
())
mathrand
.
Seed
(
time
.
Now
()
.
UnixNano
())
})
})
Context
(
"schedule pods each with a PD, delete pod and verify detach [Slow]"
,
func
()
{
Context
(
"schedule pods each with a PD, delete pod and verify detach [Slow]"
,
func
()
{
...
...
test/e2e_node/e2e_node_suite_test.go
View file @
3a243090
...
@@ -119,7 +119,7 @@ func TestE2eNode(t *testing.T) {
...
@@ -119,7 +119,7 @@ func TestE2eNode(t *testing.T) {
return
return
}
}
// If run-services-mode is not specified, run test.
// If run-services-mode is not specified, run test.
rand
.
Seed
(
time
.
Now
()
.
U
TC
()
.
U
nixNano
())
rand
.
Seed
(
time
.
Now
()
.
UnixNano
())
RegisterFailHandler
(
Fail
)
RegisterFailHandler
(
Fail
)
reporters
:=
[]
Reporter
{}
reporters
:=
[]
Reporter
{}
reportDir
:=
framework
.
TestContext
.
ReportDir
reportDir
:=
framework
.
TestContext
.
ReportDir
...
...
test/e2e_node/runner/remote/run_remote.go
View file @
3a243090
...
@@ -188,7 +188,7 @@ func main() {
...
@@ -188,7 +188,7 @@ func main() {
glog
.
Fatalf
(
"--test-suite must be one of default or conformance"
)
glog
.
Fatalf
(
"--test-suite must be one of default or conformance"
)
}
}
rand
.
Seed
(
time
.
Now
()
.
U
TC
()
.
U
nixNano
())
rand
.
Seed
(
time
.
Now
()
.
UnixNano
())
if
*
buildOnly
{
if
*
buildOnly
{
// Build the archive and exit
// Build the archive and exit
remote
.
CreateTestArchive
(
suite
,
*
systemSpecName
)
remote
.
CreateTestArchive
(
suite
,
*
systemSpecName
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment