Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Bug]: ClusterPolicy reconcile panics when a DaemonSet has no annotations

オープン
#3,096 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@SebTardif がすでに取り組んでいます。

2026年10月20日 から。

  • #3097 @SebTardif による — オープン

評価

難易度
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:

  1. Call isDaemonsetSpecChanged with a live DaemonSet whose metadata.annotations is nil.
  2. A real apps/v1 read does not produce that nil map. etcd stores the internal DaemonSet, and conversion to apps/v1 always writes deprecated.daemonset.template.generation. Removing nvidia.com/last-applied-hash leaves that annotation, so the map stays non-nil.
  3. 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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NVIDIA/gpu-operator のほかの issue

NVIDIA/gpu-operator の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。