[Bug]: ClusterPolicy reconcile panics when a DaemonSet has no annotations
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- go, kubernetes
調査の方向性
Read controllers/object_controls.go and run go test -count=1 -run TestIsDaemonsetSpecChanged/nil_live_annotations ./controllers/ to reproduce the panic. The issue says the desired DaemonSet must have allocated annotations, while a nil live annotation map should be treated like a missing hash. Done means the test passes and reconciliation updates the live DaemonSet; a pull request is already open.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
isDaemonsetSpecChanged panics when the live DaemonSet object has a nil annotation map. controller-runtime recovers the panic, so the operator process stays up, but that ClusterPolicy reconcile does not converge.
This was found by reading controllers/object_controls.go on main (operator v26.7.2). It is not a live cluster repro. The panic was added in 7843bcbfa, which assumed both DaemonSets already had an annotation map. Issue #499 was a different nil-map panic, in applyCommonDaemonsetMetadata, and that one was fixed.
To reproduce
From the code path:
- Call
isDaemonsetSpecChangedwith a live DaemonSet whosemetadata.annotationsis nil. - A real
apps/v1read does not produce that nil map. etcd stores the internal DaemonSet, and conversion toapps/v1always writesdeprecated.daemonset.template.generation. Removingnvidia.com/last-applied-hashleaves that annotation, so the map stays non-nil. - A unit test or a fake client can still pass a nil map. On main, that panics before the missing-hash branch runs.
Unit test, on current main:
go test -count=1 -run TestIsDaemonsetSpecChanged/nil_live_annotations ./controllers/
That case panics with appsv1.DaemonSet.Annotations must be allocated prior to calling isDaemonsetSpecChanged().
Expected behavior
Treat a nil live annotation map like a missing hash: set nvidia.com/last-applied-hash on the desired DaemonSet and update it. The NVIDIADriver path in internal/state/state_skel.go already does this with GetAnnotations().
The desired object should still be required to have an allocated annotation map. The caller allocates that before the compare.
I will open a pull request with that change. This does not implement #3071 (detecting spec drift beyond the stored hash).
- 主要言語
- Go
- スター
- 2.9k
- フォーク
- 576
- 平均マージ
- 1日 14時間
- マージ済み PR(30日)
- 69
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NVIDIA/gpu-operator のほかの issue
-
[Bug]: dcgm-exporter no longer gets hostNetwork when a host DCGM is set through dcgmExporter.env対応中かも @blacksoxx が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
NVIDIA/gpu-operator#3091 ·
メンテナーはふだん 1 日以内に返信
-
feature lifecycle/frozen needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
NVIDIA/gpu-operator#3074 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: nvidia-validator waits the full timeout on a failed validation pod; loadPodSpec panics対応中かも @kvalliyurnatt が 2 日前に担当しました。 オープンbug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
NVIDIA/gpu-operator#3065 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: GPUCluster common name label breaks DRA validator selector対応中かも @ajavanma が 29 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
NVIDIA/gpu-operator#2955 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: Precompiled node pools drop kernels that sanitize to the same name対応中かも @SebTardif が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 20/100
NVIDIA/gpu-operator#3098 ·
メンテナーはふだん 1 日以内に返信
NVIDIA/gpu-operator の issue をすべて見る
似ている issue
-
automation models
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
bug triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
mvanhorn/cli-printing-press#5146 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
alibaba/open-code-review#1800 ·
メンテナーはふだん 1 日以内に返信
-
kind/engineering needs-triage pulumi/registry R2 S2 Task
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信