Skip to content

Support informer names in the kcp cluster informer factory #4518

Open

Description

@mjudeikis-bot

Context

While preparing the Kubernetes 1.37 patches (kcp-dev/kubernetes-patches#2), upstream's BuildGenericConfig in pkg/controlplane/apiserver/config.go now builds the shared informer factory with clientgoinformers.WithInformerName(informerName), which gives the informers an identity for informer metrics.

The kcp carry (patches/0025-UPSTREAM-carry-generic-cleanup.patch) replaces that factory with the kcp cluster-aware one, kcpinformers.NewSharedInformerFactoryWithOptions(clusterClient, ...). That factory has no equivalent option, so the carry drops the call and leaves a comment:

Upstream additionally sets WithInformerName(informerName) for informer identity metrics; the kcp cluster informer factory does not support informer names (yet), so the identifier is unused here.

Result: informers created through the kcp factory in the generic apiserver config have no name, so they are missing from upstream's informer-identity metrics, and the carry diverges from upstream here.

What to do

Look into supporting informer names in the kcp cluster informer factory and the cluster-aware informers it creates, so the kcp patch can pass WithInformerName(informerName) again. This likely needs a change in the kcp-dev client-go / code-generator output, not only in this repo.

  • Find where the kcp cluster informer factory (kcpinformers) is generated, and which client-go informer API accepts an informer name
  • Add a WithInformerName option to the factory options and pass the name through to the underlying informers (scoped and cluster-wide)
  • Regenerate the informers and bump the dependency in kcp
  • Restore kcpinformers.WithInformerName(informerName) in the BuildGenericConfig carry patch and delete the explanatory comment
  • If this is not feasible, record that decision so the divergence from upstream is intentional

References

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions