Replace a function closure

Replace more closures with pointer conversion

Replace deprecated Int32Ptr to Int32
This commit is contained in:
Yuan Chen
2023-02-22 18:45:16 -08:00
parent 53b8170b97
commit a24aef6510
13 changed files with 66 additions and 65 deletions

View File

@@ -875,7 +875,7 @@ func TestSpecReplicasChange(t *testing.T) {
var oldGeneration int64
tester.deployment, err = tester.updateDeployment(func(update *apps.Deployment) {
oldGeneration = update.Generation
update.Spec.RevisionHistoryLimit = pointer.Int32Ptr(4)
update.Spec.RevisionHistoryLimit = pointer.Int32(4)
})
if err != nil {
t.Fatalf("failed updating deployment %q: %v", tester.deployment.Name, err)
@@ -904,7 +904,7 @@ func TestDeploymentAvailableCondition(t *testing.T) {
// Assign a high value to the deployment's minReadySeconds
tester.deployment.Spec.MinReadySeconds = 3600
// progressDeadlineSeconds must be greater than minReadySeconds
tester.deployment.Spec.ProgressDeadlineSeconds = pointer.Int32Ptr(7200)
tester.deployment.Spec.ProgressDeadlineSeconds = pointer.Int32(7200)
var err error
tester.deployment, err = c.AppsV1().Deployments(ns.Name).Create(context.TODO(), tester.deployment, metav1.CreateOptions{})
if err != nil {