diff --git a/USERS.md b/USERS.md index 837282267e..8e34c34759 100644 --- a/USERS.md +++ b/USERS.md @@ -37,6 +37,7 @@ Organizations below are **officially** using Argo Events. Please send a PR with 1. [Mobimeo GmbH](https://mobimeo.com/en/home/) 1. [OneCause](https://www.onecause.com/) 1. [Pinnacle Reliability](https://pinnaclereliability.com/) +1. [PDOK](https://pdok.nl) 1. [Phrase](https://www.phrase.com/) 1. [Produvar](https://www.produvar.com/) 1. [ProPoint Solutions](https://supersalon.com) diff --git a/eventsources/sources/resource/start.go b/eventsources/sources/resource/start.go index 301333fe7f..3eebe3375d 100644 --- a/eventsources/sources/resource/start.go +++ b/eventsources/sources/resource/start.go @@ -21,6 +21,7 @@ import ( "encoding/json" "fmt" "os" + "reflect" "regexp" "strings" "time" @@ -287,7 +288,15 @@ func passFilters(event *InformerEvent, filter *v1alpha1.ResourceFilter, startTim if filter == nil { return true } - uObj := event.Obj.(*unstructured.Unstructured) + + var uObj *unstructured.Unstructured + if castEventObject, ok := event.Obj.(*unstructured.Unstructured); ok { + uObj = castEventObject + } else { + log.Infof("event object is not of type '*unstructured.Unstructured' but of type '%s'\n", reflect.TypeOf(event.Obj).Name()) + return false + } + if len(filter.Prefix) > 0 && !strings.HasPrefix(uObj.GetName(), filter.Prefix) { log.Infof("resource name does not match prefix. resource-name: %s, prefix: %s\n", uObj.GetName(), filter.Prefix) return false