convert int32 to pointer using library function

This commit is contained in:
0xff-dev
2022-07-01 14:51:39 +08:00
parent fa16bf8e12
commit 0a77a9122f
5 changed files with 14 additions and 9 deletions

View File

@@ -41,6 +41,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/strategicpatch"
"k8s.io/utils/pointer"
)
func TestRealHistory_ListControllerRevisions(t *testing.T) {
@@ -1649,7 +1650,7 @@ func newStatefulSet(replicas int, name string, uid types.UID, labels map[string]
MatchLabels: nil,
MatchExpressions: testMatchExpressions,
},
Replicas: func() *int32 { i := int32(replicas); return &i }(),
Replicas: pointer.Int32(int32(replicas)),
Template: v1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: labels,