MCPcopy
hub / github.com/kubernetes/client-go / MetaNamespaceIndexFunc

Function MetaNamespaceIndexFunc

tools/cache/index.go:72–78  ·  view source on GitHub ↗

MetaNamespaceIndexFunc is a default index function that indexes based on an object's namespace

(obj interface{})

Source from the content-addressed store, hash-verified

70
71// MetaNamespaceIndexFunc is a default index function that indexes based on an object's namespace
72func 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
81type Index map[string]sets.String

Callers

nothing calls this directly

Calls 2

ErrorfMethod · 0.65
GetNamespaceMethod · 0.65

Tested by

no test coverage detected