Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Bug]: ClusterPolicy isDaemonSetReady can report Ready from a DaemonSet status of an older generation

未关闭 适合新手
#3,060 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@efegokdemir 已经在做这个了。

开始于 2026年10月14日。

  • #3079 来自 @efegokdemir —— 未关闭

评估

难度
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 内容生成。

描述

bug needs-triage

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.numberUnavailable before 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

环境准备

从这里开始

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

NVIDIA/gpu-operator 的其他 Issue

查看 NVIDIA/gpu-operator 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

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