Default extensions/v1beta1 Deployment's ProgressDeadlineSeconds to MaxInt32.
1. MaxInt32 has the same meaning as unset, for compatibility 2. Deployment controller treats MaxInt32 the same as unset (nil)
This commit is contained in:
@@ -18,6 +18,7 @@ package util
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
"math/rand"
|
||||
"reflect"
|
||||
"sort"
|
||||
@@ -1068,8 +1069,9 @@ func TestDeploymentProgressing(t *testing.T) {
|
||||
|
||||
func TestDeploymentTimedOut(t *testing.T) {
|
||||
var (
|
||||
null *int32
|
||||
ten = int32(10)
|
||||
null *int32
|
||||
ten = int32(10)
|
||||
infinite = int32(math.MaxInt32)
|
||||
)
|
||||
|
||||
timeFn := func(min, sec int) time.Time {
|
||||
@@ -1102,12 +1104,19 @@ func TestDeploymentTimedOut(t *testing.T) {
|
||||
expected bool
|
||||
}{
|
||||
{
|
||||
name: "no progressDeadlineSeconds specified - no timeout",
|
||||
name: "nil progressDeadlineSeconds specified - no timeout",
|
||||
|
||||
d: deployment(apps.DeploymentProgressing, v1.ConditionTrue, "", null, timeFn(1, 9)),
|
||||
nowFn: func() time.Time { return timeFn(1, 20) },
|
||||
expected: false,
|
||||
},
|
||||
{
|
||||
name: "infinite progressDeadlineSeconds specified - no timeout",
|
||||
|
||||
d: deployment(apps.DeploymentProgressing, v1.ConditionTrue, "", &infinite, timeFn(1, 9)),
|
||||
nowFn: func() time.Time { return timeFn(1, 20) },
|
||||
expected: false,
|
||||
},
|
||||
{
|
||||
name: "progressDeadlineSeconds: 10s, now - started => 00:01:20 - 00:01:09 => 11s",
|
||||
|
||||
|
Reference in New Issue
Block a user