Skip to content

Conversation

@mjudeikis
Copy link
Collaborator

This PR goes a bit wild. This is an experimental package (/exp) and an example that implements a shared cache & informer for use with multicluster-runtime.

The benefit is that we enable memory and cross-cluster queries for the reconciler (see exp-kind-shared-cache).

In a way, this is currently not possible to be built using upstream client-go packages due to hardcoded KeyFunc usage (it's strange why we have those but we can't use them as they are not exposed :) )

90% of the code here is copied from the client-go tooling for informers and cache.

This is, in a way, idea seeding effort to see if people would find this useful

On-behalf-of: SAP <mangirdas.judeikis@sap.com>
Signed-off-by: Mangirdas Judeikis <mangirdas@judeikis.lt>
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mjudeikis

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

The pull request process is described here

Details 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

@k8s-ci-robot k8s-ci-robot requested review from embik and sttts January 30, 2026 09:56
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 30, 2026
Comment on lines +50 to +52
// The key uses the format <clusterName>|<namespace>/<name> unless <namespace> is empty, then
// it's just <clusterName>|<name>, and if no cluster annotation is present,
// it's just <namespace>/<name> or <name>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there something speaking against just using <clusterName>|<namespace>/<name> regardless of whether any of them are empty? Esp. when reading debug logs I think it could help make it clearer where a cache key came from.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont think so, no

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants