1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-20 02:32:46 +00:00

Merge pull request #385 from ibuildthecloud/master

Don't filter out nil objects
This commit is contained in:
Darren Shepherd
2020-08-26 21:27:22 -07:00
committed by GitHub

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
} }