operator-framework / operator-framework/java-operator-sdk

Allow disabling or removing the default namespace index of an event source's informer

未关闭
#3,615 1 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Java
星标
944
派生
242
平均合并
1 天 4 小时
30 天内合并 PR
43

描述

For InformerEventSources, fabric8's default "namespace" index is unused: InformerWrapper.list(namespace) filters the item store directly, and byIndex only serves the JOSDK-qualified custom indexes. The index still costs one entry per object in the watched scope, and when an event source uses a filtering ItemStore to bound its cache, this unused index becomes the dominant retained memory (compounded by the fabric8 cleanup gap reported in fabric8io/kubernetes-client#8103).

fabric8 already exposes SharedIndexInformer.removeIndexer(String), but the SDK offers no path to the informer (it sits behind ManagedInformerEventSource's InformerManager and InformerWrapper, all inaccessible), so today the only way is reflection over three private fields (see the edit below, the experimental informer pool provides a path).

Suggestion: an InformerConfiguration flag (e.g. withoutNamespaceIndex()) applied when the wrapper starts the informer, or an extension point that hands advanced users the SharedIndexInformer for tuning.

Would you be open to a PR for this, and which of the two shapes would you prefer?

EDIT: found out that overriding AbstractInformerPool.start (via ConfigurationServiceOverrider.withInformerPool) allows calling SharedIndexInformer.removeNamespaceIndex() before the informer starts, so reflection is not required after all. The API is marked experimental though, and subclassing the pool for a per-informer concern is indirect, so we think a first-class InformerConfiguration option is still worth it. Happy to include that context in the PR.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先通过 InformerManager 和 InformerWrapper 跟踪 ManagedInformerEventSource,然后检查 InformerConfiguration 以及现有的 AbstractInformerPool 和 ConfigurationServiceOverrider 入口点。将这些路径与 SharedIndexInformer.removeNamespaceIndex() 进行比较。当一个一等配置选项可以禁用默认的 namespace index,而无需实验性的 pool 子类化,并且覆盖 informer 的启动行为时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
backend
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。