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

Code refactor: replace repeated values with a constant
This commit is contained in:
Kubernetes Prow Robot 2019-04-04 22:31:43 -07:00 committed by GitHub
commit a4a4b4c1db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -177,6 +177,8 @@ const (
PatchNodeTimeout = 2 * time.Minute
// TLSBootstrapTimeout specifies how long kubeadm should wait for the kubelet to perform the TLS Bootstrap
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 = 4 * time.Minute

View File

@ -116,25 +116,25 @@ func TestPrepullImagesInParallel(t *testing.T) {
{
name: "should error out; create failed",
p: NewFailedCreatePrepuller(),
timeout: 10 * time.Second,
timeout: constants.PrepullImagesInParallelTimeout,
expectedErr: true,
},
{
name: "should error out; timeout exceeded",
p: NewForeverWaitPrepuller(),
timeout: 10 * time.Second,
timeout: constants.PrepullImagesInParallelTimeout,
expectedErr: true,
},
{
name: "should error out; delete failed",
p: NewFailedDeletePrepuller(),
timeout: 10 * time.Second,
timeout: constants.PrepullImagesInParallelTimeout,
expectedErr: true,
},
{
name: "should work just fine",
p: NewGoodPrepuller(),
timeout: 10 * time.Second,
timeout: constants.PrepullImagesInParallelTimeout,
expectedErr: false,
},
}