vmware-tanzu / velero

Backup and migrate Kubernetes applications and their persistent volumes
https://velero.io
Apache License 2.0
8.77k stars 1.41k forks source link

Don't run maintenance on repo in the backup storage when BSL is ReadOnly #8238

Open maciej-p opened 1 month ago

maciej-p commented 1 month ago

What steps did you take and what happened:

At present Velero run maintenance on repo with ReadOnly BSL:

time="2024-09-23T11:03:22Z" level=info msg="Validating BackupStorageLocation" backup-storage-location=velero/production-backups controller=backup-storage-location logSource="pkg/controller/backup_storage_location_controller.go:141"
time="2024-09-23T11:03:22Z" level=info msg="Start to maintenance repo" BSL name=production-backups logSource="pkg/repository/manager.go:207" repo UID=96a92d83-baaa-4918-96ac-d7905b51b49e repo name=test-production-backups-kopia-wk2hm repo type=kopia
% velero get backup-location
NAME                 PROVIDER        BUCKET/PREFIX                     PHASE       LAST VALIDATED                   ACCESS MODE   DEFAULT
production-backups   velero.io/gcp   velero-backups/production         Available   2024-09-23 13:19:22 +0200 CEST   ReadOnly
staging-backups      velero.io/gcp   velero-backups/staging            Available   2024-09-23 13:19:42 +0200 CEST   ReadWrite     true

What did you expect to happen: Velero will skip maintenance for repo on ReadOnly BSL

The following information will help us better understand what's going on:

% velero version
Client:
    Version: v1.14.1
    Git commit: -
Server:
    Version: v1.14.1
reasonerjt commented 1 month ago

@maciej-p

I understand intuitively this does not seem very consistent, but will current behavior cause any problems?

maciej-p commented 1 month ago

@reasonerjt currently it's not a problem because maintenance job not working at all: https://github.com/vmware-tanzu/velero/issues/7987

Our staging has RO access to production BSL - just to restore something from production to staging. I'm afraid that staging maintenance job will be able prune production repos.