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

Add a way to grab the controller name out of the reconcile context #2823

Closed
jonathan-innis opened this issue May 13, 2024 · 1 comment
Closed

Comments

@jonathan-innis
Copy link
Member

There are cases where I'd like to pull the controller name that was passed through Named() out of the reconcile context. Not having it present in the context means that I have to create a separate call that injects it myself across all controllers I write, which feels redundant when controller-runtime already has this information.

What do we think about controller-runtime supporting the same method as pulling out the reconcile id, but for the controller name? This is useful when we are making calls from the controller to external endpoints and we'd like to know which "client" made the call to that external thing.

@alvaroaleman
Copy link
Member

alvaroaleman commented May 13, 2024

The difference to the reconcile ID is that the controller name doesn't change for each invocation, so you can just store it on the reconciler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants