@@ -24,7 +24,6 @@ import (
2424 "k8s.io/apimachinery/pkg/api/resource"
2525 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2626 "k8s.io/apimachinery/pkg/types"
27- "k8s.io/apimachinery/pkg/util/intstr"
2827 "k8s.io/client-go/kubernetes/fake"
2928 v1core "k8s.io/client-go/kubernetes/typed/core/v1"
3029)
@@ -47,11 +46,6 @@ type ExpectedValue struct {
4746 envVarValue string
4847}
4948
50- func toIntStr (val int ) * intstr.IntOrString {
51- b := intstr .FromInt (val )
52- return & b
53- }
54-
5549func TestGenerateSpiloJSONConfiguration (t * testing.T ) {
5650 var cluster = New (
5751 Config {
@@ -311,7 +305,7 @@ func TestGeneratePodDisruptionBudget(t *testing.T) {
311305 Labels : map [string ]string {"team" : "myapp" , "cluster-name" : "myapp-database" },
312306 },
313307 Spec : policyv1beta1.PodDisruptionBudgetSpec {
314- MinAvailable : toIntStr (1 ),
308+ MinAvailable : util . ToIntStr (1 ),
315309 Selector : & metav1.LabelSelector {
316310 MatchLabels : map [string ]string {"spilo-role" : "master" , "cluster-name" : "myapp-database" },
317311 },
@@ -335,7 +329,7 @@ func TestGeneratePodDisruptionBudget(t *testing.T) {
335329 Labels : map [string ]string {"team" : "myapp" , "cluster-name" : "myapp-database" },
336330 },
337331 Spec : policyv1beta1.PodDisruptionBudgetSpec {
338- MinAvailable : toIntStr (0 ),
332+ MinAvailable : util . ToIntStr (0 ),
339333 Selector : & metav1.LabelSelector {
340334 MatchLabels : map [string ]string {"spilo-role" : "master" , "cluster-name" : "myapp-database" },
341335 },
@@ -359,7 +353,7 @@ func TestGeneratePodDisruptionBudget(t *testing.T) {
359353 Labels : map [string ]string {"team" : "myapp" , "cluster-name" : "myapp-database" },
360354 },
361355 Spec : policyv1beta1.PodDisruptionBudgetSpec {
362- MinAvailable : toIntStr (0 ),
356+ MinAvailable : util . ToIntStr (0 ),
363357 Selector : & metav1.LabelSelector {
364358 MatchLabels : map [string ]string {"spilo-role" : "master" , "cluster-name" : "myapp-database" },
365359 },
@@ -383,7 +377,7 @@ func TestGeneratePodDisruptionBudget(t *testing.T) {
383377 Labels : map [string ]string {"team" : "myapp" , "cluster-name" : "myapp-database" },
384378 },
385379 Spec : policyv1beta1.PodDisruptionBudgetSpec {
386- MinAvailable : toIntStr (1 ),
380+ MinAvailable : util . ToIntStr (1 ),
387381 Selector : & metav1.LabelSelector {
388382 MatchLabels : map [string ]string {"spilo-role" : "master" , "cluster-name" : "myapp-database" },
389383 },
0 commit comments