@@ -1972,7 +1972,7 @@ func TestReconcileInstanceSetPodDisruptionBudget(t *testing.T) {
19721972 cluster := testCluster ()
19731973 cluster .Namespace = ns .Name
19741974 spec := & cluster .Spec .InstanceSets [0 ]
1975- spec .MinAvailable = initialize .IntOrStringInt32 ( 0 )
1975+ spec .MinAvailable = initialize .Pointer ( intstr . FromInt32 ( 0 ) )
19761976 assert .NilError (t , r .reconcileInstanceSetPodDisruptionBudget (ctx , cluster , spec ))
19771977 assert .Assert (t , ! foundPDB (cluster , spec ))
19781978 })
@@ -1981,7 +1981,7 @@ func TestReconcileInstanceSetPodDisruptionBudget(t *testing.T) {
19811981 cluster := testCluster ()
19821982 cluster .Namespace = ns .Name
19831983 spec := & cluster .Spec .InstanceSets [0 ]
1984- spec .MinAvailable = initialize .IntOrStringInt32 ( 1 )
1984+ spec .MinAvailable = initialize .Pointer ( intstr . FromInt32 ( 1 ) )
19851985
19861986 assert .NilError (t , r .Client .Create (ctx , cluster ))
19871987 t .Cleanup (func () { assert .Check (t , r .Client .Delete (ctx , cluster )) })
@@ -1990,7 +1990,7 @@ func TestReconcileInstanceSetPodDisruptionBudget(t *testing.T) {
19901990 assert .Assert (t , foundPDB (cluster , spec ))
19911991
19921992 t .Run ("deleted" , func (t * testing.T ) {
1993- spec .MinAvailable = initialize .IntOrStringInt32 ( 0 )
1993+ spec .MinAvailable = initialize .Pointer ( intstr . FromInt32 ( 0 ) )
19941994 err := r .reconcileInstanceSetPodDisruptionBudget (ctx , cluster , spec )
19951995 if apierrors .IsConflict (err ) {
19961996 // When running in an existing environment another controller will sometimes update
@@ -2008,7 +2008,7 @@ func TestReconcileInstanceSetPodDisruptionBudget(t *testing.T) {
20082008 cluster := testCluster ()
20092009 cluster .Namespace = ns .Name
20102010 spec := & cluster .Spec .InstanceSets [0 ]
2011- spec .MinAvailable = initialize .IntOrStringString ( "50%" )
2011+ spec .MinAvailable = initialize .Pointer ( intstr . FromString ( "50%" ) )
20122012
20132013 assert .NilError (t , r .Client .Create (ctx , cluster ))
20142014 t .Cleanup (func () { assert .Check (t , r .Client .Delete (ctx , cluster )) })
@@ -2017,7 +2017,7 @@ func TestReconcileInstanceSetPodDisruptionBudget(t *testing.T) {
20172017 assert .Assert (t , foundPDB (cluster , spec ))
20182018
20192019 t .Run ("deleted" , func (t * testing.T ) {
2020- spec .MinAvailable = initialize .IntOrStringString ( "0%" )
2020+ spec .MinAvailable = initialize .Pointer ( intstr . FromString ( "0%" ) )
20212021 err := r .reconcileInstanceSetPodDisruptionBudget (ctx , cluster , spec )
20222022 if apierrors .IsConflict (err ) {
20232023 // When running in an existing environment another controller will sometimes update
@@ -2031,13 +2031,13 @@ func TestReconcileInstanceSetPodDisruptionBudget(t *testing.T) {
20312031 })
20322032
20332033 t .Run ("delete with 00%" , func (t * testing.T ) {
2034- spec .MinAvailable = initialize .IntOrStringString ( "50%" )
2034+ spec .MinAvailable = initialize .Pointer ( intstr . FromString ( "50%" ) )
20352035
20362036 assert .NilError (t , r .reconcileInstanceSetPodDisruptionBudget (ctx , cluster , spec ))
20372037 assert .Assert (t , foundPDB (cluster , spec ))
20382038
20392039 t .Run ("deleted" , func (t * testing.T ) {
2040- spec .MinAvailable = initialize .IntOrStringString ( "00%" )
2040+ spec .MinAvailable = initialize .Pointer ( intstr . FromString ( "00%" ) )
20412041 err := r .reconcileInstanceSetPodDisruptionBudget (ctx , cluster , spec )
20422042 if apierrors .IsConflict (err ) {
20432043 // When running in an existing environment another controller will sometimes update
@@ -2110,13 +2110,13 @@ func TestCleanupDisruptionBudgets(t *testing.T) {
21102110 cluster := testCluster ()
21112111 cluster .Namespace = ns .Name
21122112 spec := & cluster .Spec .InstanceSets [0 ]
2113- spec .MinAvailable = initialize .IntOrStringInt32 ( 1 )
2113+ spec .MinAvailable = initialize .Pointer ( intstr . FromInt32 ( 1 ) )
21142114
21152115 assert .NilError (t , r .Client .Create (ctx , cluster ))
21162116 t .Cleanup (func () { assert .Check (t , r .Client .Delete (ctx , cluster )) })
21172117
21182118 expectedPDB := generatePDB (t , cluster , spec ,
2119- initialize .IntOrStringInt32 ( 1 ))
2119+ initialize .Pointer ( intstr . FromInt32 ( 1 ) ))
21202120 assert .NilError (t , createPDB (expectedPDB ))
21212121
21222122 t .Run ("no instances were removed" , func (t * testing.T ) {
@@ -2129,7 +2129,7 @@ func TestCleanupDisruptionBudgets(t *testing.T) {
21292129 leftoverPDB := generatePDB (t , cluster , & v1beta1.PostgresInstanceSetSpec {
21302130 Name : "old-instance" ,
21312131 Replicas : initialize .Int32 (1 ),
2132- }, initialize .IntOrStringInt32 ( 1 ))
2132+ }, initialize .Pointer ( intstr . FromInt32 ( 1 ) ))
21332133 assert .NilError (t , createPDB (leftoverPDB ))
21342134
21352135 assert .Assert (t , foundPDB (expectedPDB ))
0 commit comments