[Bug]: ClusterPolicy reconcile panics when a DaemonSet has no annotations
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- go, kubernetes
- Lĩnh vực
- backend, distributed-systems
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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).
- Ngôn ngữ chính
- Go
- Star
- 2.9k
- Fork
- 582
- Merge trung bình
- 2 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 57
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của NVIDIA/gpu-operator
-
[Bug]: dcgm-exporter no longer gets hostNetwork when a host DCGM is set through dcgmExporter.envCó thể đã có người làm @blacksoxx đã nhận 4 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
NVIDIA/gpu-operator#3091 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
feature lifecycle/frozen needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
NVIDIA/gpu-operator#3074 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: GPUCluster common name label breaks DRA validator selectorCó thể đã có người làm @ajavanma đã nhận 30 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
NVIDIA/gpu-operator#2955 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: Precompiled node pools drop kernels that sanitize to the same nameCó thể đã có người làm @SebTardif đã nhận 3 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 20/100
NVIDIA/gpu-operator#3098 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: driver-validation hides why a pre-installed driver failed and loops without a reasonCó thể đã có người làm @fjvbn2003 đã nhận 7 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 25/100
NVIDIA/gpu-operator#3085 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của NVIDIA/gpu-operator
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
FiloSottile/age#758 ·
-
nginx configĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 2 ngày
-
fix: the buttons mock cannot take back the match point -- its undo looks only for the running matchĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
stuttgart-things/zaehlwerk#168 ·
Maintainer thường phản hồi trong vòng 1 ngày