[Bug]: nvidia-validator waits the full timeout on a failed validation pod; loadPodSpec panics
Describe the bug
waitForPod(cmd/nvidia-validator/main.go:1347) only returns on phaseSucceeded. If the plugin or CUDA validation pod reachesFailed, it keeps polling for 60 × 5 s = 5 minutes and never logs why the pod failed.loadPodSpeccallspanic(err)on a read error (line 1370) and indexesslice[1]without a length check (line 1378); the parsedkindis only logged.
To Reproduce Found by code review. Make the CUDA validation pod fail (e.g. a broken runtime class) and observe the validator wait 5 minutes before erroring, with no failure reason in its log.
Expected behavior
Return immediately on PodFailed with the container's termination reason/message; return errors from loadPodSpec instead of panicking.
Environment (please provide the following information):
- GPU Operator Version: main @ f806d6b (code inspection)
We are going to keep the 5 minute timeout as it is for now and only address the loadPodSpec panics. Opened #3108 for that
Thanks @kvalliyurnatt, that works for me. Keeping the 5-minute timeout and fixing the loadPodSpec panics in #3108 covers the part that can crash the validator.