code: func (r *crdHandler) removeDeadStorage() {
  	allCustomResourceDefinitions, err := r.crdLister.List(labels.Everything())
  	if err != nil {
  		utilruntime.HandleError(err)
  		return
  	}
  
  	r.customStorageLock.Lock()
  	defer r.customStorageLock.Unlock()
  
  	storageMap := r.customStorage.Load().(crdStorageMap)
  	// Copy because we cannot write to storageMap without a race
  	// as it is used without locking elsewhere
  	storageMap2 := storageMap.clone()
  	for uid, s := range storageMap2 {
  		found := false
  		for _, crd := range allCustomResourceDefinitions {
  			if crd.UID == uid {
  				found = true
  				break
  			}
  		}
  		if !found {
  			klog.V(4).Infof("Removing dead CRD storage for %s/%s", s.spec.Group, s.spec.Names.Kind)
  			for _, storage := range s.storages {
  				// destroy only the main storage. Those for the subresources share cacher and etcd clients.
  				storage.CustomResource.DestroyFunc()
  			}
  			delete(storageMap2, uid)
  		}
  	}
  	r.customStorage.Store(storageMap2)
  }
docs: // removeDeadStorage removes REST storage that isn't being used