1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-16 15:21:33 +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 {
if namespace == "" {
if namespace == "" || obj == nil {
return true
}
meta, err := meta.Accessor(obj)
if err != nil {
return false
// if you can't figure out the namespace, just let it through
return true
}
return meta.GetNamespace() == namespace
}