ConfigMap informer panics with DeletedFinalStateUnknown type assertion
Description:
The InformedWatcher in knative/pkg/configmap/informer/informed_watcher.go crashes when handling cache.DeletedFinalStateUnknown objects during ConfigMap deletion events.
Error:
panic: interface conversion: interface {} is cache.DeletedFinalStateUnknown, not *v1.ConfigMap
Impact:
- Causes webhook pods to crash and restart repeatedly
Root Cause: Unsafe type assertion in event handlers doesn't handle DeletedFinalStateUnknown objects
Proposed Fix: Add safe type assertion with DeletedFinalStateUnknown handling
/kind bug
Hi @infernus01 ,
Thanks for the bug report! Do you feel up for patching this issue, or are you hoping that someone else will do so?
From the description, it sounds like this may be a new state in Kubernetes. What Knative and Kubernetes versions are you using?
Thanks for looking into this! Here are the version details:
knative.dev/pkg version: v0.0.0-20250415155312-ed3e2158b883
Kubernetes client version: v1.32.2
k8s.io/client-go version: v0.32.7
Tekton Pipelines version: v1.2.0-38-g85152e436
And to answer if I'm gonna patch this issue, it is open to anyone who wants to take the initiative, since I've just started with using knative I might be missing some context. The problem that I suspect is
The current knative.dev/pkg/configmap/informer/informed_watcher.go code performs unsafe type assertions:
func (i *InformedWatcher) deleteConfigMapEvent(obj interface{}) {
configMap := obj.(*corev1.ConfigMap) // UNSAFE - panics on DeletedFinalStateUnknown
// ...
}
EDIT: I got to see DeletedFinalStateUnkown in the splunk logs when a pipeline is failed due to some exit code 2.
This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.
I can take this one and work on a fix. Will post a PR shortly.