code: func GetDeletableResources(discoveryClient discovery.ServerResourcesInterface) map[schema.GroupVersionResource]struct{} {
  	preferredResources, err := discoveryClient.ServerPreferredResources()
  	if err != nil {
  		if discovery.IsGroupDiscoveryFailedError(err) {
  			klog.Warningf("failed to discover some groups: %v", err.(*discovery.ErrGroupDiscoveryFailed).Groups)
  		} else {
  			klog.Warningf("failed to discover preferred resources: %v", err)
  		}
  	}
  	if preferredResources == nil {
  		return map[schema.GroupVersionResource]struct{}{}
  	}
  
  	// This is extracted from discovery.GroupVersionResources to allow tolerating
  	// failures on a per-resource basis.
  	deletableResources := discovery.FilteredBy(discovery.SupportsAllVerbs{Verbs: []string{"delete", "list", "watch"}}, preferredResources)
  	deletableGroupVersionResources := map[schema.GroupVersionResource]struct{}{}
  	for _, rl := range deletableResources {
  		gv, err := schema.ParseGroupVersion(rl.GroupVersion)
  		if err != nil {
  			klog.Warningf("ignoring invalid discovered resource %q: %v", rl.GroupVersion, err)
  			continue
  		}
  		for i := range rl.APIResources {
  			deletableGroupVersionResources[schema.GroupVersionResource{Group: gv.Group, Version: gv.Version, Resource: rl.APIResources[i].Name}] = struct{}{}
  		}
  	}
  
  	return deletableGroupVersionResources
  }
docs: // GetDeletableResources returns all resources from discoveryClient that the
  // garbage collector should recognize and work with. More specifically, all
  // preferred resources which support the 'delete', 'list', and 'watch' verbs.
  //
  // All discovery errors are considered temporary. Upon encountering any error,
  // GetDeletableResources will log and return any discovered resources it was
  // able to process (which may be none).