Increase default value of DeploymentSpec.RevisionHistoryLimit to 10

This commit is contained in:
Di Xu 2017-08-01 10:53:23 +08:00
parent 1bc56825a2
commit 7b45e5344b
3 changed files with 6 additions and 6 deletions

View File

@ -102,7 +102,7 @@ func SetDefaults_StatefulSet(obj *appsv1beta2.StatefulSet) {
// in extensions. These addons are:
// - MaxUnavailable during rolling update set to 25% (1 in extensions)
// - MaxSurge value during rolling update set to 25% (1 in extensions)
// - RevisionHistoryLimit set to 2 (not set in extensions)
// - RevisionHistoryLimit set to 10 (not set in extensions)
// - ProgressDeadlineSeconds set to 600s (not set in extensions)
func SetDefaults_Deployment(obj *appsv1beta2.Deployment) {
// Default labels and selector to labels from pod template spec.
@ -144,7 +144,7 @@ func SetDefaults_Deployment(obj *appsv1beta2.Deployment) {
}
if obj.Spec.RevisionHistoryLimit == nil {
obj.Spec.RevisionHistoryLimit = new(int32)
*obj.Spec.RevisionHistoryLimit = 2
*obj.Spec.RevisionHistoryLimit = 10
}
if obj.Spec.ProgressDeadlineSeconds == nil {
obj.Spec.ProgressDeadlineSeconds = new(int32)

View File

@ -186,7 +186,7 @@ func TestSetDefaultDeployment(t *testing.T) {
MaxUnavailable: &defaultIntOrString,
},
},
RevisionHistoryLimit: newInt32(2),
RevisionHistoryLimit: newInt32(10),
ProgressDeadlineSeconds: newInt32(600),
Template: defaultTemplate,
},
@ -213,7 +213,7 @@ func TestSetDefaultDeployment(t *testing.T) {
MaxUnavailable: &defaultIntOrString,
},
},
RevisionHistoryLimit: newInt32(2),
RevisionHistoryLimit: newInt32(10),
ProgressDeadlineSeconds: newInt32(600),
Template: defaultTemplate,
},
@ -239,7 +239,7 @@ func TestSetDefaultDeployment(t *testing.T) {
MaxUnavailable: &defaultIntOrString,
},
},
RevisionHistoryLimit: newInt32(2),
RevisionHistoryLimit: newInt32(10),
ProgressDeadlineSeconds: newInt32(600),
Template: defaultTemplate,
},

View File

@ -307,7 +307,7 @@ 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.
// Defaults to 2.
// Defaults to 10.
// +optional
RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty" protobuf:"varint,6,opt,name=revisionHistoryLimit"`