@@ -36,7 +36,6 @@ import (
36
36
"k8s.io/client-go/kubernetes/fake"
37
37
clienttesting "k8s.io/client-go/testing"
38
38
testingclock "k8s.io/utils/clock/testing"
39
- "k8s.io/utils/pointer"
40
39
"k8s.io/utils/ptr"
41
40
42
41
"k8s.io/klog/v2"
@@ -73,8 +72,8 @@ func TestNewNodeLease(t *testing.T) {
73
72
Namespace : corev1 .NamespaceNodeLease ,
74
73
},
75
74
Spec : coordinationv1.LeaseSpec {
76
- HolderIdentity : pointer . StringPtr (node .Name ),
77
- LeaseDurationSeconds : pointer . Int32Ptr (10 ),
75
+ HolderIdentity : ptr . To (node .Name ),
76
+ LeaseDurationSeconds : ptr. To [ int32 ] (10 ),
78
77
RenewTime : & metav1.MicroTime {Time : fakeClock .Now ()},
79
78
},
80
79
},
@@ -103,8 +102,8 @@ func TestNewNodeLease(t *testing.T) {
103
102
},
104
103
},
105
104
Spec : coordinationv1.LeaseSpec {
106
- HolderIdentity : pointer . StringPtr (node .Name ),
107
- LeaseDurationSeconds : pointer . Int32Ptr (10 ),
105
+ HolderIdentity : ptr . To (node .Name ),
106
+ LeaseDurationSeconds : ptr. To [ int32 ] (10 ),
108
107
RenewTime : & metav1.MicroTime {Time : fakeClock .Now ()},
109
108
},
110
109
},
@@ -123,8 +122,8 @@ func TestNewNodeLease(t *testing.T) {
123
122
Namespace : corev1 .NamespaceNodeLease ,
124
123
},
125
124
Spec : coordinationv1.LeaseSpec {
126
- HolderIdentity : pointer . StringPtr (node .Name ),
127
- LeaseDurationSeconds : pointer . Int32Ptr (10 ),
125
+ HolderIdentity : ptr . To (node .Name ),
126
+ LeaseDurationSeconds : ptr. To [ int32 ] (10 ),
128
127
RenewTime : & metav1.MicroTime {Time : fakeClock .Now ().Add (- 10 * time .Second )},
129
128
},
130
129
},
@@ -142,8 +141,8 @@ func TestNewNodeLease(t *testing.T) {
142
141
},
143
142
},
144
143
Spec : coordinationv1.LeaseSpec {
145
- HolderIdentity : pointer . StringPtr (node .Name ),
146
- LeaseDurationSeconds : pointer . Int32Ptr (10 ),
144
+ HolderIdentity : ptr . To (node .Name ),
145
+ LeaseDurationSeconds : ptr. To [ int32 ] (10 ),
147
146
RenewTime : & metav1.MicroTime {Time : fakeClock .Now ()},
148
147
},
149
148
},
@@ -170,8 +169,8 @@ func TestNewNodeLease(t *testing.T) {
170
169
},
171
170
},
172
171
Spec : coordinationv1.LeaseSpec {
173
- HolderIdentity : pointer . StringPtr (node .Name ),
174
- LeaseDurationSeconds : pointer . Int32Ptr (10 ),
172
+ HolderIdentity : ptr . To (node .Name ),
173
+ LeaseDurationSeconds : ptr. To [ int32 ] (10 ),
175
174
RenewTime : & metav1.MicroTime {Time : fakeClock .Now ().Add (- 10 * time .Second )},
176
175
},
177
176
},
@@ -189,8 +188,8 @@ func TestNewNodeLease(t *testing.T) {
189
188
},
190
189
},
191
190
Spec : coordinationv1.LeaseSpec {
192
- HolderIdentity : pointer . StringPtr (node .Name ),
193
- LeaseDurationSeconds : pointer . Int32Ptr (10 ),
191
+ HolderIdentity : ptr . To (node .Name ),
192
+ LeaseDurationSeconds : ptr. To [ int32 ] (10 ),
194
193
RenewTime : & metav1.MicroTime {Time : fakeClock .Now ()},
195
194
},
196
195
},
0 commit comments