Skip to content

Terminating resources held by a finalizer keep being served #11

Open

Description

@shreemaan-abhishek

Problem

Sources are built from every listed object without a DeletionTimestamp check (reconciler.go#L71-L82). Credential Secrets aren't checked either.

Reproduce

An APIKey with finalizer example.com/hold is served; after kubectl delete it is Terminating, yet further reconciles still serve its key_hash with Programmed=True until the finalizer is released.

Impact

Deleting an APIKey to revoke it leaves the key working while it is Terminating. Common sources: --cascade=foreground (usually seconds), custom tooling, or a stuck finalizer.

Scores

Reproducibility Likelihood Severity Existing mitigations Detectability Test coverage Fix cost vs benefit
10 2 6 3 3 2 9

Scores are out of 10. Higher is worse for likelihood and severity. Higher is better for mitigations, detectability, test coverage and cost vs benefit (10 = cheap fix, high value).

Fix

Skip objects with DeletionTimestamp != nil when building sources and when patching status, and skip terminating Secrets as credential sources. A terminating object then renders exactly as it will once deleted.

Tests to add

An envtest with a foreign finalizer: delete, reconcile, assert the key is gone from the file.

Activity

  1. coderabbitai commented on Nov 10, 2026

    @coderabbitai
    🔗 Related PRs

    #3 - Revert "feat: first version of aisix-controller" [open]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions