[Bug]: ClusterPolicy isDaemonSetReady can report Ready from a DaemonSet status of an older generation
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
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- go, kubernetes
- Lĩnh vực
- infrastructure
Hướng nghiên cứu
Bắt đầu từ isDaemonSetReady trong controllers/object_controls.go, khoảng dòng 4030, rồi so sánh với phiên bản đã được sửa trong internal/state/state_skel.go, nơi kiểm tra status.observedGeneration so với metadata.generation. Thêm cùng một lớp bảo vệ để đường dẫn ClusterPolicy trả về chưa sẵn sàng cho đến khi generation được quan sát, kể cả trường hợp số pod được lên lịch bằng không. Hoàn thành khi một unit test với generation 2, observedGeneration 1 và desiredNumberScheduled 0 báo chưa sẵn sàng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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)
- Ngôn ngữ chính
- Go
- Star
- 2.9k
- Fork
- 576
- Merge trung bình
- 1 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 90
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
-
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 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: nvidia-validator waits the full timeout on a failed validation pod; loadPodSpec panicsĐang mởbug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
NVIDIA/gpu-operator#3065 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: Driver upgrade does not evict pods that use nvidia.com/gpu only in a native sidecarCó thể đã có người làm @JunAr7112 đã nhận 3 ngày trước. Đang mởbug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NVIDIA/gpu-operator#3026 · 1 người được giao ·
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 22 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 needs-triage
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 35/100
NVIDIA/gpu-operator#3077 ·
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ự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Gentleman-Programming/engram#1899 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/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 72/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 70/100
OpenTollGate/tollgate-module-basic-go#949 ·
Maintainer thường phản hồi trong vòng 1 ngày