kubernetes / kubernetes

Production-Grade Container Scheduling and Management
https://kubernetes.io
Apache License 2.0
108.65k stars 38.97k forks source link

Informer: Single TweakListOptionsFunc type #123457

Open alice-sawatzky opened 5 months ago

alice-sawatzky commented 5 months ago

What would you like to be added?

Currently, every SharedInformerFactory has an associated factory_interfaces.go file. In this generated file, there's a type called TweakListOptionsFunc func(*"k8s.io/apimachinery/pkg/apis/meta/v1".ListOptions). This could be moved to a single type somewhere shared (perhaps in k8s.io/apimachinery/pkg/apis/meta/v1), so that this common type can be passed around more easily.

Why is this needed?

I'm trying to use generics to make a simple controller framework, and this is one of the sticking points preventing me from presenting a common interface for managing both internal and external types. This likely ties in to the larger discussion on #106846

alice-sawatzky commented 5 months ago

/sig api-machinery

jiahuif commented 4 months ago

cc @deads2k As followup of https://github.com/kubernetes/kubernetes/issues/106846 , and one of the authors of factory_interfaces.go files. /triage accepted

nikzayn commented 1 month ago

Hey @alice-sawatzky, @jiahuif. Can I take this up?