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
a4a4b4c1
Unverified
Commit
a4a4b4c1
authored
Apr 04, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Apr 04, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #76119 from SataQiu/improve-kubeadm-20190404
Code refactor: replace repeated values with a constant
parents
71f4c9a5
4a200a22
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
constants.go
cmd/kubeadm/app/constants/constants.go
+2
-0
prepull_test.go
cmd/kubeadm/app/phases/upgrade/prepull_test.go
+4
-4
No files found.
cmd/kubeadm/app/constants/constants.go
View file @
a4a4b4c1
...
@@ -177,6 +177,8 @@ const (
...
@@ -177,6 +177,8 @@ const (
PatchNodeTimeout
=
2
*
time
.
Minute
PatchNodeTimeout
=
2
*
time
.
Minute
// TLSBootstrapTimeout specifies how long kubeadm should wait for the kubelet to perform the TLS Bootstrap
// TLSBootstrapTimeout specifies how long kubeadm should wait for the kubelet to perform the TLS Bootstrap
TLSBootstrapTimeout
=
2
*
time
.
Minute
TLSBootstrapTimeout
=
2
*
time
.
Minute
// PrepullImagesInParallelTimeout specifies how long kubeadm should wait for prepulling images in parallel before timing out
PrepullImagesInParallelTimeout
=
10
*
time
.
Second
// DefaultControlPlaneTimeout specifies the default control plane (actually API Server) timeout for use by kubeadm
// DefaultControlPlaneTimeout specifies the default control plane (actually API Server) timeout for use by kubeadm
DefaultControlPlaneTimeout
=
4
*
time
.
Minute
DefaultControlPlaneTimeout
=
4
*
time
.
Minute
...
...
cmd/kubeadm/app/phases/upgrade/prepull_test.go
View file @
a4a4b4c1
...
@@ -116,25 +116,25 @@ func TestPrepullImagesInParallel(t *testing.T) {
...
@@ -116,25 +116,25 @@ func TestPrepullImagesInParallel(t *testing.T) {
{
{
name
:
"should error out; create failed"
,
name
:
"should error out; create failed"
,
p
:
NewFailedCreatePrepuller
(),
p
:
NewFailedCreatePrepuller
(),
timeout
:
10
*
time
.
Second
,
timeout
:
constants
.
PrepullImagesInParallelTimeout
,
expectedErr
:
true
,
expectedErr
:
true
,
},
},
{
{
name
:
"should error out; timeout exceeded"
,
name
:
"should error out; timeout exceeded"
,
p
:
NewForeverWaitPrepuller
(),
p
:
NewForeverWaitPrepuller
(),
timeout
:
10
*
time
.
Second
,
timeout
:
constants
.
PrepullImagesInParallelTimeout
,
expectedErr
:
true
,
expectedErr
:
true
,
},
},
{
{
name
:
"should error out; delete failed"
,
name
:
"should error out; delete failed"
,
p
:
NewFailedDeletePrepuller
(),
p
:
NewFailedDeletePrepuller
(),
timeout
:
10
*
time
.
Second
,
timeout
:
constants
.
PrepullImagesInParallelTimeout
,
expectedErr
:
true
,
expectedErr
:
true
,
},
},
{
{
name
:
"should work just fine"
,
name
:
"should work just fine"
,
p
:
NewGoodPrepuller
(),
p
:
NewGoodPrepuller
(),
timeout
:
10
*
time
.
Second
,
timeout
:
constants
.
PrepullImagesInParallelTimeout
,
expectedErr
:
false
,
expectedErr
:
false
,
},
},
}
}
...
...
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