Skip to content

[Bug]: Backups field indexer used by ScheduledBackup controller always returns empty #9485

@andrew-farries

Description

@andrew-farries

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

andrew.farries@xata.io

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:

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: self

When 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

Metadata

Metadata

Assignees

Labels

bug 🐛Something isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions