code: func (m *kubeGenericRuntimeManager) getSandboxIDByPodUID(podUID kubetypes.UID, state *runtimeapi.PodSandboxState) ([]string, error) {
  	filter := &runtimeapi.PodSandboxFilter{
  		LabelSelector: map[string]string{types.KubernetesPodUIDLabel: string(podUID)},
  	}
  	if state != nil {
  		filter.State = &runtimeapi.PodSandboxStateValue{
  			State: *state,
  		}
  	}
  	sandboxes, err := m.runtimeService.ListPodSandbox(filter)
  	if err != nil {
  		klog.Errorf("ListPodSandbox with pod UID %q failed: %v", podUID, err)
  		return nil, err
  	}
  
  	if len(sandboxes) == 0 {
  		return nil, nil
  	}
  
  	// Sort with newest first.
  	sandboxIDs := make([]string, len(sandboxes))
  	sort.Sort(podSandboxByCreated(sandboxes))
  	for i, s := range sandboxes {
  		sandboxIDs[i] = s.Id
  	}
  
  	return sandboxIDs, nil
  }
docs: // getPodSandboxID gets the sandbox id by podUID and returns ([]sandboxID, error).
  // Param state could be nil in order to get all sandboxes belonging to same pod.