From e078032e469effdfc492c8eea97eb2701ceda0c2 Mon Sep 17 00:00:00 2001 From: Alexander Matyushentsev Date: Fri, 28 Dec 2018 15:31:55 -0800 Subject: [PATCH] Issue #1132 - Fix panic in ttl controller (#1143) --- workflow/ttlcontroller/ttlcontroller.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/workflow/ttlcontroller/ttlcontroller.go b/workflow/ttlcontroller/ttlcontroller.go index 91d2b992bd52..d5862127a321 100644 --- a/workflow/ttlcontroller/ttlcontroller.go +++ b/workflow/ttlcontroller/ttlcontroller.go @@ -130,7 +130,12 @@ func (c *Controller) processNextWorkItem() bool { // enqueueWF conditionally queues a workflow to the ttl queue if it is within the deletion period func (c *Controller) enqueueWF(obj interface{}) { - wf, err := util.FromUnstructured(obj.(*unstructured.Unstructured)) + un, ok := obj.(*unstructured.Unstructured) + if !ok { + log.Warnf("'%v' is not an unstructured", obj) + return + } + wf, err := util.FromUnstructured(un) if err != nil { log.Warnf("Failed to unmarshal workflow %v object: %v", obj, err) return