Unverified Commit a4a4b4c1 authored by Kubernetes Prow Robot's avatar Kubernetes Prow Robot Committed by GitHub

Merge pull request #76119 from SataQiu/improve-kubeadm-20190404

Code refactor: replace repeated values with a constant
parents 71f4c9a5 4a200a22
...@@ -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
......
...@@ -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,
}, },
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment