Skip to content

bug: APIBinding lock on crd deletion is not removed from logicalCluster annotation #3799

Closed

Description

@BergCyrill

Describe the bug

When adding and deleting a crd in a workspace the GRV lock does not gets cleaned up, so one cannot create an APIBinding for the same apigroup (refer to slack thread https://kubernetes.slack.com/archives/C021U8WSAFK/p1769013090663529).
I suspect there is an issue that the expiry property is not written in the logicalcluster annotation: https://github.com/kcp-dev/kcp/blob/release-0.29/pkg/reconciler/apis/apibinding/logical_cluster_lock.go

Steps To Reproduce

  1. Create an example CRD
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: networks.foo.bar.com
spec:
  group: foo.bar.com
  versions:
    - name: v1alpha1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          properties:
            spec:
              type: object
              properties:
                foo:
                  type: string
                bar:
                  type: integer
  scope: Namespaced
  names:
    plural: networks
    singular: network
    kind: Network
  1. Delete the created CRD
  2. Take a look at the logicalCluster annotation:
kubectl get logicalcluster cluster -o jsonpath='{.metadata.annotations.internal\.apis\.kcp\.io\/resource-bindings}'

There is an entry "networks.foo.bar":{"c":true} showing the binded crd although it is deleted and there is no "e" property set.

  1. Even after waiting the suggested 30s the entry is not cleaned up.

Expected Behaviour

When a CRD is deleted the annotation is cleaned up (maybe with a delay allowed by CRDExpiry) so one can create an APIBinding for the same apigroup.

Additional Context

No response

Activity

  1. added
    priority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to complete.
    on Jan 23, 2026
  2. added theissue type on Jan 23, 2026
  3. moved this from New to Backlog in kcpon Jan 23, 2026
  4. added this to the v0.31.0 milestone on Jan 23, 2026
  5. added
    good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.
    on Jan 23, 2026
  6. AutuSnow commented on Jan 24, 2026

    @AutuSnow

    /assign

  7. kcp-ci-bot commented on Apr 24, 2026

    @kcp-ci-bot
    Contributor

    Issues go stale after 90d of inactivity.
    After a furter 30 days, they will turn rotten.
    Mark the issue as fresh with /remove-lifecycle stale.

    If this issue is safe to close now please do so with /close.

    /lifecycle stale

  8. added
    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.
    on Apr 24, 2026
  9. modified the milestones: v0.31.0, v0.32.0 on May 12, 2026
  10. kcp-ci-bot commented on Jun 11, 2026

    @kcp-ci-bot
    Contributor

    Stale issues rot after 30d of inactivity.
    Mark the issue as fresh with /remove-lifecycle rotten.
    Rotten issues close after an additional 30d of inactivity.

    If this issue is safe to close now please do so with /close.

    /lifecycle rotten

  11. added
    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.
    and removed
    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.
    on Jun 11, 2026
  12. added a commit that references this issue on Jun 26, 2026
    1ceca2e
  13. BergCyrill commented on Jun 27, 2026

    @BergCyrill
    ContributorAuthor

    /remove-lifecycle rotten

  14. removed
    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.
    on Jun 27, 2026
  15. BergCyrill commented on Jun 27, 2026

    @BergCyrill
    ContributorAuthor

    /assign

  16. moved this from Backlog to Done in kcpon Jul 13, 2026
  17. added a commit that references this issue on Oct 6, 2026
    6586a71
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.kind/bugCategorizes issue or PR as related to a bug.priority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to complete.

Type

Projects

  • Status
    Done

Relationships

None yet

Development

No branches or pull requests

Issue actions