Backups Job show some permission errors in the log
Summary
Backups Job show some permission errors in the log
Current Behaviour
Permission errors are showed in the logs
Steps to reproduce
- Create a cluster with backup config in a namespace
- Create a cluster with backup config in another namespace
- Create a backup for the first cluster
- Create a backup for the second cluster
Expected Behaviour
Permission errors are not showed in the logs
Environment
- StackGres version: 1.2.0
- Kubernetes version: ?
- Cloud provider or hardware configuration: ?
Relevant logs and/or screenshots
Lock acquired
Error from server (Forbidden): sgbackups.stackgres.io is forbidden: User "system:serviceaccount:ndb-stage1:ndb-metadata-store-stage-backup" cannot list resource "sgbackups" in API group "stackgres.io" in the namespace "ndb-dev2"
Error from server (Forbidden): sgbackups.stackgres.io is forbidden: User "system:serviceaccount:ndb-stage1:ndb-metadata-store-stage-backup" cannot list resource "sgbackups" in API group "stackgres.io" in the namespace "ndb-dev3"
Creating backup CR
apiVersion: stackgres.io/v1
kind: SGBackup
metadata:
annotations:
scheduled-backup: "true"
stackgres.io/operatorVersion: 1.2.0-SNAPSHOT
creationTimestamp: "2022-05-18T00:00:08Z"
generation: 1
name: ndb-metadata-store-stage-2022-05-18-00-00-07
namespace: ndb-stage1
resourceVersion: "58474934"
uid: 8588c36a-d51c-49fc-9479-40c93d36dfbc
spec:
managedLifecycle: true
sgCluster: ndb-metadata-store-stage
status:
process:
jobPod: ndb-metadata-store-stage-backup-27547200--1-f4ljp
status: Running
sgBackupConfig:
baseBackups:
compression: lz4
storage:
s3:
awsCredentials:
secretKeySelectors:
accessKeyId:
key: accessKeyId
name: eks-backup-bucket-secret
secretAccessKey:
key: secretAccessKey
name: eks-backup-bucket-secret
bucket: era-stackgres-backup
type: s3
Retrieving primary and replica
Primary is pod/ndb-metadata-store-stage-0
Replica not found, primary will be used for cleanups
Performing backup
Backup completed
Extracting pg_controldata
Extraction of pg_controldata completed
Retain backups
Check if backup base_000000010000000000000004 has to be retained and will retain 3 backups
Mark base_000000010000000000000004 as permanent and will retain 2 more backups
INFO: 2022/05/18 00:00:15.029810 Retrieving previous related backups to be marked: toPermanent=true
INFO: 2022/05/18 00:00:15.310107 Retrieved backups to be marked, marking: [base_000000010000000000000004]
Cleaning up impermanent backups
INFO: 2022/05/18 00:00:15.856539 retrieving permanent objects
INFO: 2022/05/18 00:00:16.027291 Found permanent objects: backups=map[base_000000010000000000000004:true], wals=map[000000010000000000000004:true]
INFO: 2022/05/18 00:00:16.186865 Start delete
INFO: 2022/05/18 00:00:16.369698 Objects in folder:
INFO: 2022/05/18 00:00:16.369744 will be deleted: wal_005/000000010000000000000001.lz4
INFO: 2022/05/18 00:00:16.369752 will be deleted: wal_005/000000010000000000000002.lz4
INFO: 2022/05/18 00:00:16.369759 will be deleted: wal_005/000000010000000000000003.lz4
Check if backup base_000000010000000000000004 has to be set permanent or impermanent
Mark base_000000010000000000000004 as impermanent
INFO: 2022/05/18 00:00:17.458217 Retrieving previous related backups to be marked: toPermanent=false
INFO: 2022/05/18 00:00:17.602567 retrieving permanent objects
INFO: 2022/05/18 00:00:17.863245 Retrieved backups to be marked, marking: [base_000000010000000000000004]
Reconciliation of backups completed
Listing existing backups
Updating backup CR as completed
sgbackup.stackgres.io/ndb-metadata-store-stage-2022-05-18-00-00-07 patched
Backup CR updated as completed
Reconcile backup CRs
Reconciliation of backup CRs completed
Lock released