code: func (g *GenericPLEG) getPodIP(pid types.UID, status *kubecontainer.PodStatus) string {
  	if status.IP != "" {
  		return status.IP
  	}
  
  	oldStatus, err := g.cache.Get(pid)
  	if err != nil || oldStatus.IP == "" {
  		return ""
  	}
  
  	for _, sandboxStatus := range status.SandboxStatuses {
  		// If at least one sandbox is ready, then use this status update's pod IP
  		if sandboxStatus.State == runtimeapi.PodSandboxState_SANDBOX_READY {
  			return status.IP
  		}
  	}
  
  	if len(status.SandboxStatuses) == 0 {
  		// Without sandboxes (which built-in runtimes like rkt don't report)
  		// look at all the container statuses, and if any containers are
  		// running then use the new pod IP
  		for _, containerStatus := range status.ContainerStatuses {
  			if containerStatus.State == kubecontainer.ContainerStateCreated || containerStatus.State == kubecontainer.ContainerStateRunning {
  				return status.IP
  			}
  		}
  	}
  
  	// For pods with no ready containers or sandboxes (like exited pods)
  	// use the old status' pod IP
  	return oldStatus.IP
  }
docs: // getPodIP preserves an older cached status' pod IP if the new status has no pod IP
  // and its sandboxes have exited