From 7b45e5344b3d540aa2e4af5b9b38d59b0f5a035e Mon Sep 17 00:00:00 2001 From: Di Xu Date: Tue, 1 Aug 2017 10:53:23 +0800 Subject: [PATCH] Increase default value of DeploymentSpec.RevisionHistoryLimit to 10 --- pkg/apis/apps/v1beta2/defaults.go | 4 ++-- pkg/apis/apps/v1beta2/defaults_test.go | 6 +++--- staging/src/k8s.io/api/apps/v1beta2/types.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/apis/apps/v1beta2/defaults.go b/pkg/apis/apps/v1beta2/defaults.go index 102750339cd..f1046b16ff5 100644 --- a/pkg/apis/apps/v1beta2/defaults.go +++ b/pkg/apis/apps/v1beta2/defaults.go @@ -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) diff --git a/pkg/apis/apps/v1beta2/defaults_test.go b/pkg/apis/apps/v1beta2/defaults_test.go index 6a9ba308f14..d017a52688c 100644 --- a/pkg/apis/apps/v1beta2/defaults_test.go +++ b/pkg/apis/apps/v1beta2/defaults_test.go @@ -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, }, diff --git a/staging/src/k8s.io/api/apps/v1beta2/types.go b/staging/src/k8s.io/api/apps/v1beta2/types.go index 6aada49f6e2..d680be2caea 100644 --- a/staging/src/k8s.io/api/apps/v1beta2/types.go +++ b/staging/src/k8s.io/api/apps/v1beta2/types.go @@ -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"`