mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-13 11:25:19 +00:00
Merge pull request #66605 from islinwb/default_RevisionHistoryLimit
Default extensions/v1beta1 Deployment's RevisionHistoryLimit to MaxInt32
This commit is contained in:
@@ -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