code: func GetAvailableResources(clientBuilder controller.ControllerClientBuilder) (map[schema.GroupVersionResource]bool, error) {
  	client := clientBuilder.ClientOrDie("controller-discovery")
  	discoveryClient := client.Discovery()
  	resourceMap, err := discoveryClient.ServerResources()
  	if err != nil {
  		utilruntime.HandleError(fmt.Errorf("unable to get all supported resources from server: %v", err))
  	}
  	if len(resourceMap) == 0 {
  		return nil, fmt.Errorf("unable to get any supported resources from server")
  	}
  
  	allResources := map[schema.GroupVersionResource]bool{}
  	for _, apiResourceList := range resourceMap {
  		version, err := schema.ParseGroupVersion(apiResourceList.GroupVersion)
  		if err != nil {
  			return nil, err
  		}
  		for _, apiResource := range apiResourceList.APIResources {
  			allResources[version.WithResource(apiResource.Name)] = true
  		}
  	}
  
  	return allResources, nil
  }
docs: // TODO: In general, any controller checking this needs to be dynamic so
  //  users don't have to restart their controller manager if they change the apiserver.
  // Until we get there, the structure here needs to be exposed for the construction of a proper ControllerContext.