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:
@@ -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
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user