code: func (gc *GarbageCollector) getMetadata(apiVersion, kind, namespace, name string) (metav1.Object, error) {
  	apiResource, _, err := gc.apiResource(apiVersion, kind)
  	if err != nil {
  		return nil, err
  	}
  	gc.dependencyGraphBuilder.monitorLock.RLock()
  	defer gc.dependencyGraphBuilder.monitorLock.RUnlock()
  	m, ok := gc.dependencyGraphBuilder.monitors[apiResource]
  	if !ok || m == nil {
  		// If local cache doesn't exist for mapping.Resource, send a GET request to API server
  		return gc.dynamicClient.Resource(apiResource).Namespace(namespace).Get(name, metav1.GetOptions{})
  	}
  	key := name
  	if len(namespace) != 0 {
  		key = namespace + "/" + name
  	}
  	raw, exist, err := m.store.GetByKey(key)
  	if err != nil {
  		return nil, err
  	}
  	if !exist {
  		// If local cache doesn't contain the object, send a GET request to API server
  		return gc.dynamicClient.Resource(apiResource).Namespace(namespace).Get(name, metav1.GetOptions{})
  	}
  	obj, ok := raw.(runtime.Object)
  	if !ok {
  		return nil, fmt.Errorf("expect a runtime.Object, got %v", raw)
  	}
  	return meta.Accessor(obj)
  }
docs: // getMetadata tries getting object metadata from local cache, and sends GET request to apiserver when
  // local cache is not available or not latest.