[Bug]: ClusterPolicy isDaemonSetReady can report Ready from a DaemonSet status of an older generation
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- go, kubernetes
调研方向
从 controllers/object_controls.go 中约第 4030 行的 isDaemonSetReady 开始,并将其与已修复的 internal/state/state_skel.go 版本进行比较,后者会将 status.observedGeneration 与 metadata.generation 进行检查。添加相同的保护,使 ClusterPolicy 路径在 generation 被观察到之前返回未就绪,包括计划调度的数量为零的情况。当 generation 为 2、observedGeneration 为 1、desiredNumberScheduled 为 0 的单元测试报告未就绪时,即完成。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
#2968 fixed internal/state/state_skel.go:isDaemonSetReady to require status.observedGeneration >= metadata.generation. The ClusterPolicy implementation in controllers/object_controls.go:4030 still lacks that check:
- line 4040 returns Ready whenever
status.desiredNumberScheduled == 0, including for a DaemonSet whose status the DaemonSet controller has not populated yet; - line 4045 trusts
status.numberUnavailablebefore the new generation is observed.
A freshly created or just-updated operand DaemonSet can therefore be reported Ready on the first reconcile pass, so ClusterPolicy can flip Ready → NotReady and later states proceed before the operand is actually scheduled.
To Reproduce
Found by code review; not yet reproduced on a cluster. Unit-level: call isDaemonSetReady with a DaemonSet with generation: 2, status.observedGeneration: 1, desiredNumberScheduled: 0 → returns Ready.
Expected behavior
Same semantics as the fixed state_skel implementation: not ready until observedGeneration >= generation.
Suggested fix
Add the observedGeneration guard, or share one readiness helper between the ClusterPolicy and NVIDIADriver/GPUCluster stacks.
Environment (please provide the following information):
- GPU Operator Version: main @ f806d6b (code inspection)
- 主要语言
- Go
- 星标
- 2.9k
- 派生
- 569
- 平均合并
- 1 天 5 小时
- 30 天内合并 PR
- 90
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NVIDIA/gpu-operator 的其他 Issue
-
feature lifecycle/frozen needs-triage
难度 2/5 1-3 小时 新手友好度 68/100
NVIDIA/gpu-operator#3074 ·
维护者通常 1 天内回复
-
bug needs-triage
难度 2/5 1-3 小时 新手友好度 75/100
NVIDIA/gpu-operator#3065 ·
维护者通常 1 天内回复
-
[Bug]: Driver upgrade does not evict pods that use nvidia.com/gpu only in a native sidecar可能已有人在做 @JunAr7112 于 2 天前认领。 未关闭bug needs-triage
难度 2/5 1-3 小时 新手友好度 78/100
NVIDIA/gpu-operator#3026 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[Bug]: GPUCluster common name label breaks DRA validator selector可能已有人在做 @ajavanma 于 22 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
NVIDIA/gpu-operator#2955 · 1 条评论 ·
维护者通常 1 天内回复
-
bug needs-triage
难度 4/5 1-2 天 新手友好度 35/100
NVIDIA/gpu-operator#3077 ·
维护者通常 1 天内回复
查看 NVIDIA/gpu-operator 的全部 Issue
相似的 Issue
-
component/server severity/minor type/bug
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
diagnose globalnet reports a failure for every exported headless Service可能已有人在做 @kurtyoon 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
submariner-io/subctl#1948 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
-
help wanted
难度 2/5 1-3 小时 新手友好度 70/100
meshery-extensions/meshery-mcp-server#63 · 1 条评论 ·
-
help wanted
难度 2/5 1-3 小时 新手友好度 62/100