additionalMetadata changes never reach the PDB or the Services
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- go, kubernetes
调研方向
Start in controllers/etcdcluster_controller.go: reconcilePDB (around line 1548, with the early return near lines 1574-1580) and ensureService (around line 1851) apply additionalMetadata only in their IsNotFound branches. The README.md line near 26 describes the field's wording. Done means either metadata changes reach the PDB and both Services on update, without overwriting annotations injected by webhooks, or the README wording is corrected. The maintainers have not yet decided which, so confirm the approach in the issue before coding.
由索引模型根据 Issue 内容生成。
描述
spec.additionalMetadata merges user labels/annotations onto every object the operator creates. For the per-member objects (member Pods, data PVCs, EtcdMember CRs) that happens on each object's creation, so an edit lands naturally as members are replaced. For the cluster-scoped objects it never lands: the PDB and both Services are created once and live for the cluster's whole lifetime, and applyAdditionalMetadata is only called in their IsNotFound branches.
controllers/etcdcluster_controller.go:1548—reconcilePDBapplies the metadata only when creating the PDB. The update path below it comparesminAvailable/maxUnavailableand returns early when they match (controllers/etcdcluster_controller.go:1574-1580), so labels and annotations are never revisited.controllers/etcdcluster_controller.go:1851—ensureServicehas the same shape: metadata on create, and the drift reconcile below it covers spec fields only.
Effect: adding or changing a key under spec.additionalMetadata on a running cluster applies to member Pods as they roll, but never to that cluster's PDB or its <cluster> / <cluster>-client Services. The objects stay inconsistent with each other indefinitely, and the only way to converge them is to delete the object and let the operator recreate it. That is easy to hit with the common case of adding a cost-allocation or ownership label to an existing cluster.
README.md:26 describes the field as "All three apply on object creation and are latched like the rest of the spec", which is literally accurate but reads as "applies to objects created from now on" rather than "never applies to these three objects". Either the behaviour or the wording should change.
Worth settling as part of the fix: whether this metadata should be reconciled on update at all. ensureService already documents that admission webhooks routinely inject annotations onto Services and that the operator deliberately does not fight them, so a blind overwrite of the whole annotation map would be a regression. Merging only the keys that spec.additionalMetadata currently declares, and removing only the ones it previously declared, would preserve that property — which implies tracking the previously-applied key set somewhere.
- 主要语言
- Go
- 星标
- 154
- 派生
- 31
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cozystack/etcd-operator 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
cozystack/etcd-operator#385 ·
-
难度 5/5 一周以上 新手友好度 35/100
cozystack/etcd-operator#383 ·
-
难度 5/5 一周以上 新手友好度 15/100
cozystack/etcd-operator#381 ·
-
难度 4/5 3-5 天 新手友好度 35/100
cozystack/etcd-operator#374 · 1 条评论 ·
-
Adoption deletes the legacy cluster-state ConfigMap but leaves Pods referencing it, and neither self-heal path detects the result可能已有人在做 @androndo 于 46 天前认领。 未关闭bug
难度 4/5 3-5 天 新手友好度 35/100
cozystack/etcd-operator#373 ·
查看 cozystack/etcd-operator 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
-
Correct local module testing instructions for Go sample contributors可能已有人在做 @slievrly 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 90/100
-
internal/core: cleanAttachmentName splits a rune at the 255-byte cap and stores invalid UTF-8可能已有人在做 @pacwestnobody 今天认领。 未关闭go good first issue help wanted
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
TestLaunchGolden spends about 98 seconds on fake-agent exit delays under -race可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
factory:subtask
难度 1/5 1 小时以内 新手友好度 95/100
维护者通常 1 天内回复