@@ -29,6 +29,7 @@ import (
29
29
"k8s.io/apimachinery/pkg/types"
30
30
"k8s.io/apimachinery/pkg/util/rand"
31
31
"k8s.io/apimachinery/pkg/util/wait"
32
+ "k8s.io/client-go/tools/record"
32
33
"sigs.k8s.io/controller-runtime/pkg/client"
33
34
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
34
35
"sigs.k8s.io/controller-runtime/pkg/manager"
@@ -4430,8 +4431,9 @@ func TestGetRepoHostVolumeRequests(t *testing.T) {
4430
4431
require .ParallelCapacity (t , 1 )
4431
4432
4432
4433
reconciler := & Reconciler {
4433
- Client : tClient ,
4434
- Owner : client .FieldOwner (t .Name ()),
4434
+ Client : tClient ,
4435
+ Owner : client .FieldOwner (t .Name ()),
4436
+ Recorder : new (record.FakeRecorder ),
4435
4437
}
4436
4438
4437
4439
testCases := []struct {
@@ -4505,11 +4507,41 @@ func TestGetRepoHostVolumeRequests(t *testing.T) {
4505
4507
t .Cleanup (func () { assert .Check (t , tClient .Delete (ctx , repoHost )) })
4506
4508
}
4507
4509
4510
+ // A limit is expected otherwise an empty string ("") is returned
4511
+ testRepoPVC := func () * v1beta1.RepoPVC {
4512
+ return & v1beta1.RepoPVC {
4513
+ VolumeClaimSpec : v1beta1.VolumeClaimSpec {
4514
+ AccessModes : []corev1.PersistentVolumeAccessMode {corev1 .ReadWriteOnce },
4515
+ Resources : corev1.VolumeResourceRequirements {
4516
+ Limits : map [corev1.ResourceName ]resource.Quantity {
4517
+ corev1 .ResourceStorage : resource .MustParse ("1Gi" ),
4518
+ },
4519
+ }}}
4520
+ }
4521
+
4508
4522
cluster := & v1beta1.PostgresCluster {
4509
4523
ObjectMeta : metav1.ObjectMeta {
4510
4524
Name : "orange" ,
4511
4525
Namespace : namespace ,
4512
4526
},
4527
+ Spec : v1beta1.PostgresClusterSpec {
4528
+ Backups : v1beta1.Backups {
4529
+ PGBackRest : v1beta1.PGBackRestArchive {
4530
+ Repos : []v1beta1.PGBackRestRepo {
4531
+ {
4532
+ Name : "repo1" ,
4533
+ Volume : testRepoPVC (),
4534
+ }, {
4535
+ Name : "repo2" ,
4536
+ Volume : testRepoPVC (),
4537
+ }, {
4538
+ Name : "repo3" ,
4539
+ Volume : testRepoPVC (),
4540
+ }, {
4541
+ Name : "repo4" ,
4542
+ Volume : testRepoPVC (),
4543
+ },
4544
+ }}}},
4513
4545
Status : v1beta1.PostgresClusterStatus {
4514
4546
PGBackRest : & v1beta1.PGBackRestStatus {},
4515
4547
},
0 commit comments