Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting the last NatsJetStreamChannel in a namespace when namespace-scoped can result in orphaned resources #544

Open
dan-j opened this issue Apr 14, 2024 · 0 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@dan-j
Copy link
Contributor

dan-j commented Apr 14, 2024

Describe the bug
If you have a NatsJetStreamChannel in a namespace with the eventing.knative.dev/scope: namespace annotation set, a dispatcher is deployed to that namespace. If the channel is then deleted, the controller deletes the dispatcher deployment, but sometimes the dispatcher doesn't have time to delete the underlying stream and/or consumers.

We can't move the stream/consumer management to the controller, because the credentials to the NATS cluster are based on the dispatcher (and we have different credentials in different namespaces).

What we really need to do is have multiple finalizers on the channel, so the actual channel isn't deleted until both reconcilers have time to finalize the resource. Once all finalizers are removed, it will then be deleted and the controller can remove the dispatcher deployment.

Expected behavior
Any underlying resources are cleaned up when a channel is deleted.

To Reproduce
See above.

Knative release version
Latest

Additional context
I already have the start of this fix in a big WIP which includes #542 and #543

@dan-j dan-j added the kind/bug Categorizes issue or PR as related to a bug. label Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

1 participant