Merge pull request #66605 from islinwb/default_RevisionHistoryLimit
Default extensions/v1beta1 Deployment's RevisionHistoryLimit to MaxInt32
This commit is contained in:
@@ -110,6 +110,8 @@ type DeploymentSpec struct {
|
||||
|
||||
// The number of old ReplicaSets to retain to allow rollback.
|
||||
// This is a pointer to distinguish between explicit zero and not specified.
|
||||
// This is set to the max value of int32 (i.e. 2147483647) by default, which means
|
||||
// "retaining all old ReplicaSets".
|
||||
// +optional
|
||||
RevisionHistoryLimit *int32
|
||||
|
||||
|
@@ -118,6 +118,12 @@ func SetDefaults_Deployment(obj *extensionsv1beta1.Deployment) {
|
||||
obj.Spec.ProgressDeadlineSeconds = new(int32)
|
||||
*obj.Spec.ProgressDeadlineSeconds = math.MaxInt32
|
||||
}
|
||||
// Set extensionsv1beta1.DeploymentSpec.RevisionHistoryLimit to MaxInt32,
|
||||
// which has the same meaning as unset.
|
||||
if obj.Spec.RevisionHistoryLimit == nil {
|
||||
obj.Spec.RevisionHistoryLimit = new(int32)
|
||||
*obj.Spec.RevisionHistoryLimit = math.MaxInt32
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_ReplicaSet(obj *extensionsv1beta1.ReplicaSet) {
|
||||
|
@@ -196,6 +196,7 @@ func TestSetDefaultDeployment(t *testing.T) {
|
||||
},
|
||||
Template: defaultTemplate,
|
||||
ProgressDeadlineSeconds: utilpointer.Int32Ptr(math.MaxInt32),
|
||||
RevisionHistoryLimit: utilpointer.Int32Ptr(math.MaxInt32),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -222,6 +223,7 @@ func TestSetDefaultDeployment(t *testing.T) {
|
||||
},
|
||||
Template: defaultTemplate,
|
||||
ProgressDeadlineSeconds: utilpointer.Int32Ptr(math.MaxInt32),
|
||||
RevisionHistoryLimit: utilpointer.Int32Ptr(math.MaxInt32),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -247,6 +249,7 @@ func TestSetDefaultDeployment(t *testing.T) {
|
||||
},
|
||||
Template: defaultTemplate,
|
||||
ProgressDeadlineSeconds: utilpointer.Int32Ptr(math.MaxInt32),
|
||||
RevisionHistoryLimit: utilpointer.Int32Ptr(math.MaxInt32),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -267,6 +270,7 @@ func TestSetDefaultDeployment(t *testing.T) {
|
||||
},
|
||||
Template: defaultTemplate,
|
||||
ProgressDeadlineSeconds: utilpointer.Int32Ptr(math.MaxInt32),
|
||||
RevisionHistoryLimit: utilpointer.Int32Ptr(math.MaxInt32),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -288,6 +292,7 @@ func TestSetDefaultDeployment(t *testing.T) {
|
||||
},
|
||||
Template: defaultTemplate,
|
||||
ProgressDeadlineSeconds: utilpointer.Int32Ptr(30),
|
||||
RevisionHistoryLimit: utilpointer.Int32Ptr(math.MaxInt32),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user