convert int32 to pointer using library function
This commit is contained in:
@@ -52,6 +52,7 @@ import (
|
||||
"k8s.io/kubernetes/pkg/features"
|
||||
"k8s.io/kubernetes/pkg/securitycontext"
|
||||
testingclock "k8s.io/utils/clock/testing"
|
||||
"k8s.io/utils/pointer"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
@@ -76,7 +77,7 @@ func newReplicationController(replicas int) *v1.ReplicationController {
|
||||
ResourceVersion: "18",
|
||||
},
|
||||
Spec: v1.ReplicationControllerSpec{
|
||||
Replicas: func() *int32 { i := int32(replicas); return &i }(),
|
||||
Replicas: pointer.Int32(int32(replicas)),
|
||||
Selector: map[string]string{"foo": "bar"},
|
||||
Template: &v1.PodTemplateSpec{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
@@ -138,7 +139,7 @@ func newReplicaSet(name string, replicas int) *apps.ReplicaSet {
|
||||
ResourceVersion: "18",
|
||||
},
|
||||
Spec: apps.ReplicaSetSpec{
|
||||
Replicas: func() *int32 { i := int32(replicas); return &i }(),
|
||||
Replicas: pointer.Int32(int32(replicas)),
|
||||
Selector: &metav1.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}},
|
||||
Template: v1.PodTemplateSpec{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
|
Reference in New Issue
Block a user