code: func (m *ManagerImpl) GetDeviceRunContainerOptions(pod *v1.Pod, container *v1.Container) (*DeviceRunContainerOptions, error) {
  	podUID := string(pod.UID)
  	contName := container.Name
  	needsReAllocate := false
  	for k := range container.Resources.Limits {
  		resource := string(k)
  		if !m.isDevicePluginResource(resource) {
  			continue
  		}
  		err := m.callPreStartContainerIfNeeded(podUID, contName, resource)
  		if err != nil {
  			return nil, err
  		}
  		// This is a device plugin resource yet we don't have cached
  		// resource state. This is likely due to a race during node
  		// restart. We re-issue allocate request to cover this race.
  		if m.podDevices.containerDevices(podUID, contName, resource) == nil {
  			needsReAllocate = true
  		}
  	}
  	if needsReAllocate {
  		klog.V(2).Infof("needs re-allocate device plugin resources for pod %s", podUID)
  		m.allocatePodResources(pod)
  	}
  	m.mutex.Lock()
  	defer m.mutex.Unlock()
  	return m.podDevices.deviceRunContainerOptions(string(pod.UID), container.Name), nil
  }
docs: // GetDeviceRunContainerOptions checks whether we have cached containerDevices
  // for the passed-in <pod, container> and returns its DeviceRunContainerOptions
  // for the found one. An empty struct is returned in case no cached state is found.