MetaNamespaceIndexFunc is a default index function that indexes based on an object's namespace
(obj interface{})
| 70 | |
| 71 | // MetaNamespaceIndexFunc is a default index function that indexes based on an object's namespace |
| 72 | func MetaNamespaceIndexFunc(obj interface{}) ([]string, error) { |
| 73 | meta, err := meta.Accessor(obj) |
| 74 | if err != nil { |
| 75 | return []string{""}, fmt.Errorf("object has no meta: %v", err) |
| 76 | } |
| 77 | return []string{meta.GetNamespace()}, nil |
| 78 | } |
| 79 | |
| 80 | // Index maps the indexed value to a set of keys in the store that match on that value |
| 81 | type Index map[string]sets.String |
nothing calls this directly
no test coverage detected