@@ -24,7 +24,6 @@ import (
24
24
"k8s.io/apimachinery/pkg/api/resource"
25
25
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
26
26
"k8s.io/apimachinery/pkg/types"
27
- "k8s.io/apimachinery/pkg/util/intstr"
28
27
"k8s.io/client-go/kubernetes/fake"
29
28
v1core "k8s.io/client-go/kubernetes/typed/core/v1"
30
29
)
@@ -47,11 +46,6 @@ type ExpectedValue struct {
47
46
envVarValue string
48
47
}
49
48
50
- func toIntStr (val int ) * intstr.IntOrString {
51
- b := intstr .FromInt (val )
52
- return & b
53
- }
54
-
55
49
func TestGenerateSpiloJSONConfiguration (t * testing.T ) {
56
50
var cluster = New (
57
51
Config {
@@ -311,7 +305,7 @@ func TestGeneratePodDisruptionBudget(t *testing.T) {
311
305
Labels : map [string ]string {"team" : "myapp" , "cluster-name" : "myapp-database" },
312
306
},
313
307
Spec : policyv1beta1.PodDisruptionBudgetSpec {
314
- MinAvailable : toIntStr (1 ),
308
+ MinAvailable : util . ToIntStr (1 ),
315
309
Selector : & metav1.LabelSelector {
316
310
MatchLabels : map [string ]string {"spilo-role" : "master" , "cluster-name" : "myapp-database" },
317
311
},
@@ -335,7 +329,7 @@ func TestGeneratePodDisruptionBudget(t *testing.T) {
335
329
Labels : map [string ]string {"team" : "myapp" , "cluster-name" : "myapp-database" },
336
330
},
337
331
Spec : policyv1beta1.PodDisruptionBudgetSpec {
338
- MinAvailable : toIntStr (0 ),
332
+ MinAvailable : util . ToIntStr (0 ),
339
333
Selector : & metav1.LabelSelector {
340
334
MatchLabels : map [string ]string {"spilo-role" : "master" , "cluster-name" : "myapp-database" },
341
335
},
@@ -359,7 +353,7 @@ func TestGeneratePodDisruptionBudget(t *testing.T) {
359
353
Labels : map [string ]string {"team" : "myapp" , "cluster-name" : "myapp-database" },
360
354
},
361
355
Spec : policyv1beta1.PodDisruptionBudgetSpec {
362
- MinAvailable : toIntStr (0 ),
356
+ MinAvailable : util . ToIntStr (0 ),
363
357
Selector : & metav1.LabelSelector {
364
358
MatchLabels : map [string ]string {"spilo-role" : "master" , "cluster-name" : "myapp-database" },
365
359
},
@@ -383,7 +377,7 @@ func TestGeneratePodDisruptionBudget(t *testing.T) {
383
377
Labels : map [string ]string {"team" : "myapp" , "cluster-name" : "myapp-database" },
384
378
},
385
379
Spec : policyv1beta1.PodDisruptionBudgetSpec {
386
- MinAvailable : toIntStr (1 ),
380
+ MinAvailable : util . ToIntStr (1 ),
387
381
Selector : & metav1.LabelSelector {
388
382
MatchLabels : map [string ]string {"spilo-role" : "master" , "cluster-name" : "myapp-database" },
389
383
},
0 commit comments