obj := &v1.Pod{...} key, _ := cache.MetaNamespaceKeyFunc(obj) store.Add(key, obj)
key, _ := cache.MetaNamespaceKeyFunc(obj) obj, exists, err := store.GetByKey(key) if err != nil { // handle error } if exists { // handle object }Here, the key is created using the same MetaNamespaceKeyFunc as before. The GetByKey method is then used to retrieve the object from the store and determine if it exists. Overall, the go k8s.io/kubernetes/pkg/client/cache Store package library provides a useful set of tools for working with Kubernetes API objects in a cache.