code: func (d *CachedDiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error) {
  	filename := filepath.Join(d.cacheDirectory, groupVersion, "serverresources.json")
  	cachedBytes, err := d.getCachedFile(filename)
  	// don't fail on errors, we either don't have a file or won't be able to run the cached check. Either way we can fallback.
  	if err == nil {
  		cachedResources := &metav1.APIResourceList{}
  		if err := runtime.DecodeInto(scheme.Codecs.UniversalDecoder(), cachedBytes, cachedResources); err == nil {
  			klog.V(10).Infof("returning cached discovery info from %v", filename)
  			return cachedResources, nil
  		}
  	}
  
  	liveResources, err := d.delegate.ServerResourcesForGroupVersion(groupVersion)
  	if err != nil {
  		klog.V(3).Infof("skipped caching discovery info due to %v", err)
  		return liveResources, err
  	}
  	if liveResources == nil || len(liveResources.APIResources) == 0 {
  		klog.V(3).Infof("skipped caching discovery info, no resources found")
  		return liveResources, err
  	}
  
  	if err := d.writeCachedFile(filename, liveResources); err != nil {
  		klog.V(1).Infof("failed to write cache to %v due to %v", filename, err)
  	}
  
  	return liveResources, nil
  }
docs: // ServerResourcesForGroupVersion returns the supported resources for a group and version.