Skip to content

[Bug]: Pooler and DatabaseRole reconcilers keep recreating owned resources during deletion, blocking external finalizers (e.g. ArgoCD foreground pruning) #11360

Description

@mjlshen

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

No response

Version

1.30.0

What version of Kubernetes are you using?

1.36

What is your Kubernetes environment?

Cloud: Amazon EKS

How did you install the operator?

Helm

What happened?

When a Pooler or DatabaseRole object has a deletionTimestamp set but is not yet fully deleted (e.g. because an external controller such as ArgoCD has added a finalizer for foreground pruning), the corresponding CloudNativePG reconciler does not check for the deletion tinormal reconciliation. As a result, the owned
external controller such as ArgoCD has added pruning), the corresponding CloudNativePGreconciler does not check for the deletion timestamp before continuing normal reconciliation. As a result, the owned resources are continuously recreated/updated:

  • PoolerReconciler.Reconcile recreates/updates the owned Deployment and Service for a Pooler that is being deleted.
  • DatabaseRoleReconciler.Reconcile recreates the owned client-certificate Secret for a DatabaseRole that is being deleted.

Because the owned resources are kept alive, the object never actually becomes empty of dependents, and any external
finalizer relying on garbage collection to obte (e.g. ArgoCD's foreground pruning policy)
never clears, leaving the resource stuck in a

To Reproduce

  1. Configure ArgoCD (or any tool using Kubernropagation) to manage a Pooler (or
    DatabaseRole) resource, with the default fore
  2. Delete the resource (e.g. via ArgoCD sync/
  3. Observe that the Pooler's Deployment/Serviclient cert Secret) keeps getting recreated by
    the operator, and the parent resource never f

Expected behavior

Once metadata.deletionTimestamp is set on a P operator should stop reconciling/recreating
the resources it owns, so Kubernetes garbage al finalizers) can proceed normally.

Additional context

Reported in discussion #4010 ("Delete Pooler goCD pruning"). Other reconcilers already
guard against this correctly (cluster_controleletionTimestamp(), plugin_controller.go
checks service.DeletionTimestamp.IsZero()), but databaserole_controller.go did not.

Cluster resource

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added
    bug 🐛
    triage
    on Aug 21, 2026
  2. mearsten commented on Sep 3, 2026

    @mearsten

    We're experiencing similar problem with werf (it sets a finalizer too). CNPG 1.30.0, k8s 1.34.

  3. mou commented on Sep 3, 2026

    @mou

    We are facing the same issue. It prevents us from provisioning and reprovisioning instances of our application without manual intervention. CNPG 1.30.0, k8s 1.34

  4. mjlshen commented on Sep 4, 2026

    @mjlshen
    ContributorAuthor

    I've been trying to respectfully look for a reviewer for my PR and have left a message in the #cloudnativepg-dev slack channel to hopefully get some eyes on this. I personally agree that it's quite an impactful issue.

  5. mjlshen commented on Sep 10, 2026

    @mjlshen
    ContributorAuthor

    @gbartolini are you the right person to ask to review #11359 (or at least enable the first pass of CI to run)? I noticed you're a maintainer and unsure what the 👍 emoji on my previous comment means

  6. mjlshen commented on Sep 20, 2026

    @mjlshen
    ContributorAuthor

    @fcanovai @leonardoce @mnencia @armru

    Sorry for the wide blast, but it's been many weeks and I believe this bug is fairly impactful. Can a maintainer please approve CI (and ideally review) #11359 please? If I can provide any information to push this forward, let me know!

  7. added this to the 1.30.1 milestone on Sep 21, 2026
  8. removed
    triage
    on Sep 21, 2026
  9. added theissue type on Sep 21, 2026
  10. added a commit that references this issue on Sep 21, 2026
    9bb80d2
  11. added a commit that references this issue on Sep 21, 2026
    7651be7
  12. added 2 commits that reference this issue on Sep 21, 2026
    a5f6d37
    0ad9261
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug 🐛

Type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions