[Bug]: ClusterPolicy reconcile panics when a DaemonSet has no annotations
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- go, kubernetes
- Área
- backend, distributed-systems
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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).
- Lenguaje dominante
- Go
- Estrellas
- 2.9k
- Forks
- 582
- Merge medio
- 1 d 14 h
- PR fusionados (30 d)
- 69
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de NVIDIA/gpu-operator
-
[Bug]: dcgm-exporter no longer gets hostNetwork when a host DCGM is set through dcgmExporter.envPosiblemente ocupada @blacksoxx la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
NVIDIA/gpu-operator#3091 ·
Los mantenedores suelen responder en 1 día
-
feature lifecycle/frozen needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
NVIDIA/gpu-operator#3074 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
[Bug]: nvidia-validator waits the full timeout on a failed validation pod; loadPodSpec panicsPosiblemente ocupada @kvalliyurnatt la tomó hace 2 días. Abiertobug needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
NVIDIA/gpu-operator#3065 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[Bug]: GPUCluster common name label breaks DRA validator selectorPosiblemente ocupada @ajavanma la tomó hace 29 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
NVIDIA/gpu-operator#2955 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Bug]: Precompiled node pools drop kernels that sanitize to the same namePosiblemente ocupada @SebTardif la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 20/100
NVIDIA/gpu-operator#3098 ·
Los mantenedores suelen responder en 1 día
Todos los issues de NVIDIA/gpu-operator
Issues similares
-
native
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
prime-radiant-inc/evener#4839 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
521xueweihan/HelloGitHub#4073 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
goharbor/terraform-provider-harbor#655 · 1 comentario ·
-
bug needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
syncthing/syncthing#10935 · 1 comentario ·
Los mantenedores suelen responder en 1 día