1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-16 23:29:16 +00:00

Don't filter out nil objects

This commit is contained in:
Darren Shepherd
2020-08-26 21:25:00 -07:00
parent aae987b999
commit 8933f573f8

View File

@@ -73,12 +73,13 @@ func (g *genericController) AddHandler(ctx context.Context, name string, handler
} }
func isNamespace(namespace string, obj runtime.Object) bool { func isNamespace(namespace string, obj runtime.Object) bool {
if namespace == "" { if namespace == "" || obj == nil {
return true return true
} }
meta, err := meta.Accessor(obj) meta, err := meta.Accessor(obj)
if err != nil { if err != nil {
return false // if you can't figure out the namespace, just let it through
return true
} }
return meta.GetNamespace() == namespace return meta.GetNamespace() == namespace
} }