Skip to content

🐛 Re-wire additional indexers into informers creation #45

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

Closed

Conversation

embik
Copy link
Member

@embik embik commented Feb 1, 2024

While trying to use controller-runtime, I ran into the issue that I couldn't do List calls when the logical cluster was set in my ctx. The error I got was

Index with name cluster does not exist

Now I'm not an expert with those kube internals, but I spent some significant time delving into this and I discovered the following: In #10, kcp specific indexers were added. These were wired up properly. It seems we might have lost that in #42 (or maybe before), where the cache.Options field Indexers still exists but it is unused and therefore does not reach the part of the code where informers are created.

This PR re-wires the additional indexers and it solved the problem with calling List, but I have honestly no idea if it's the best way to do it or if there is some way to pass it already that i missed. The indexers in addInformerToMap looked pretty hardcoded to me, but again, limited knowledge.

I hope someone has a good enough understanding of controller-runtime's cache package that they can review this properly.

Signed-off-by: Marvin Beckers <marvin@kubermatic.com>
@kcp-ci-bot kcp-ci-bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Feb 1, 2024
@kcp-ci-bot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign stevekuznetsov for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kcp-ci-bot kcp-ci-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Feb 1, 2024
@embik embik mentioned this pull request Feb 7, 2024
@embik
Copy link
Member Author

embik commented Feb 7, 2024

Closing in favour of #46. Much cleaner fix.

@embik embik closed this Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: yes Indicates the PR's author has signed the DCO. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants