@@ -2947,96 +2947,14 @@ volumes:
29472947 })
29482948 })
29492949
2950- t .Run ("CloudLogVolumeAnnotationNoPvc" , func (t * testing.T ) {
2951- recorder := events .NewRecorder (t , runtime .Scheme )
2952- r .Recorder = recorder
2953-
2954- cluster .Namespace = ns .Name
2955- cluster .Annotations = map [string ]string {}
2956- cluster .Annotations [naming .PGBackRestCloudLogVolume ] = "some-pvc"
2957- spec := r .generateBackupJobSpecIntent (ctx ,
2958- & cluster , v1beta1.PGBackRestRepo {},
2959- "" ,
2960- nil , nil ,
2961- )
2962- assert .Assert (t , cmp .MarshalMatches (spec .Template .Spec , `
2963- containers:
2964- - command:
2965- - /bin/pgbackrest
2966- - backup
2967- - --stanza=db
2968- - --repo=
2969- name: pgbackrest
2970- resources: {}
2971- securityContext:
2972- allowPrivilegeEscalation: false
2973- capabilities:
2974- drop:
2975- - ALL
2976- privileged: false
2977- readOnlyRootFilesystem: true
2978- runAsNonRoot: true
2979- seccompProfile:
2980- type: RuntimeDefault
2981- volumeMounts:
2982- - mountPath: /etc/pgbackrest/conf.d
2983- name: pgbackrest-config
2984- readOnly: true
2985- - mountPath: /tmp
2986- name: tmp
2987- enableServiceLinks: false
2988- restartPolicy: Never
2989- securityContext:
2990- fsGroup: 26
2991- fsGroupChangePolicy: OnRootMismatch
2992- volumes:
2993- - name: pgbackrest-config
2994- projected:
2995- sources:
2996- - configMap:
2997- items:
2998- - key: pgbackrest_cloud.conf
2999- path: pgbackrest_cloud.conf
3000- name: hippo-test-pgbackrest-config
3001- - secret:
3002- items:
3003- - key: pgbackrest.ca-roots
3004- path: ~postgres-operator/tls-ca.crt
3005- - key: pgbackrest-client.crt
3006- path: ~postgres-operator/client-tls.crt
3007- - key: pgbackrest-client.key
3008- mode: 384
3009- path: ~postgres-operator/client-tls.key
3010- name: hippo-test-pgbackrest
3011- - emptyDir:
3012- sizeLimit: 16Mi
3013- name: tmp
3014- ` ))
3015-
3016- assert .Equal (t , len (recorder .Events ), 1 )
3017- assert .Equal (t , recorder .Events [0 ].Regarding .Name , cluster .Name )
3018- assert .Equal (t , recorder .Events [0 ].Reason , "PGBackRestCloudLogVolumeNotFound" )
3019- assert .Equal (t , recorder .Events [0 ].Note , "persistentvolumeclaims \" some-pvc\" not found" )
3020- })
3021-
3022- t .Run ("CloudLogVolumeAnnotationPvcInPlace" , func (t * testing.T ) {
2950+ t .Run ("CloudLogVolumeAnnotation" , func (t * testing.T ) {
30232951 recorder := events .NewRecorder (t , runtime .Scheme )
30242952 r .Recorder = recorder
30252953
30262954 cluster .Namespace = ns .Name
30272955 cluster .Annotations = map [string ]string {}
30282956 cluster .Annotations [naming .PGBackRestCloudLogVolume ] = "another-pvc"
30292957
3030- pvc := & corev1.PersistentVolumeClaim {
3031- ObjectMeta : metav1.ObjectMeta {
3032- Name : "another-pvc" ,
3033- Namespace : ns .Name ,
3034- },
3035- Spec : corev1 .PersistentVolumeClaimSpec (testVolumeClaimSpec ()),
3036- }
3037- err := r .Client .Create (ctx , pvc )
3038- assert .NilError (t , err )
3039-
30402958 spec := r .generateBackupJobSpecIntent (ctx ,
30412959 & cluster , v1beta1.PGBackRestRepo {},
30422960 "" ,
0 commit comments