Skip to content

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

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

[email protected]

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

Activity

  1. andrew-farries commented on Dec 17, 2025

    @andrew-farries
    ContributorAuthor

    PR to remove the indexer is here: #9466

  2. armru commented on Dec 18, 2025

    @armru
    Member

    I think we could fix the bug with a minimal approach: #9489

  3. added
    bug 🐛Something isn't working
    and removed
    triagePending triage
    on Dec 22, 2025
  4. added theissue type on Dec 22, 2025
  5. added 3 commits that reference this issue on Dec 23, 2025
    1fad243
    1d58ca3
    8f136af
  6. added a commit that references this issue on Dec 23, 2025
    54d9c2b
  7. added a commit that references this issue on Jan 20, 2026
    868e133
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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