-
Notifications
You must be signed in to change notification settings - Fork 632
Description
Is there an existing issue already for this bug?
- I have searched for an existing issue, and could not find anything. I believe this is a new bug.
I have read the troubleshooting guide
- I have read the troubleshooting guide and I think this is a new bug.
I am running a supported version of CloudNativePG
- I have read the troubleshooting guide and I think this is a new bug.
Contact Details
Version
trunk (main)
What version of Kubernetes are you using?
1.34
What is your Kubernetes environment?
Self-managed: kind (evaluation)
How did you install the operator?
YAML manifest
What happened?
The indexer used by the ScheduledBackup controller to find child Backups doesn't work because it checks Backups for owner references of kind Backup instead of ScheduledBackup:
cloudnative-pg/internal/controller/scheduledbackup_controller.go
Lines 350 to 352 in e2d6bd0
| if owner.Kind != apiv1.BackupKind { | |
| return nil | |
| } |
This check means that the indexer never returns any results and so the GetChildBackups method always returns an empty slice.
Even if it correctly looked for owners of kind ScheduledBackup, it would only work for the cases where the ScheduledBackup is configured with:
backupOwnerReference: selfWhen backupOwnerReference is set to none (the default) or cluster this indexer will also not return anything.
The intended purpose of the GetChildBackups method that uses the indexer is to prevent concurrent Backups for a ScheduledBackup. The check has never worked and the Backup controller handles concurrency itself by checking for running Backups before starting a new one.
The indexer should be removed.
Cluster resource
Relevant log output
Code of Conduct
- I agree to follow this project's Code of Conduct