code: func waitForPod(pod *v1.Pod, recyclerClient recyclerClient, podCh <-chan watch.Event) error {
  	for {
  		event, ok := <-podCh
  		if !ok {
  			return fmt.Errorf("recycler pod %q watch channel had been closed", pod.Name)
  		}
  		switch event.Object.(type) {
  		case *v1.Pod:
  			// POD changed
  			pod := event.Object.(*v1.Pod)
  			klog.V(4).Infof("recycler pod update received: %s %s/%s %s", event.Type, pod.Namespace, pod.Name, pod.Status.Phase)
  			switch event.Type {
  			case watch.Added, watch.Modified:
  				if pod.Status.Phase == v1.PodSucceeded {
  					// Recycle succeeded.
  					return nil
  				}
  				if pod.Status.Phase == v1.PodFailed {
  					if pod.Status.Message != "" {
  						return fmt.Errorf(pod.Status.Message)
  					}
  					return fmt.Errorf("pod failed, pod.Status.Message unknown")
  				}
  
  			case watch.Deleted:
  				return fmt.Errorf("recycler pod was deleted")
  
  			case watch.Error:
  				return fmt.Errorf("recycler pod watcher failed")
  			}
  
  		case *v1.Event:
  			// Event received
  			podEvent := event.Object.(*v1.Event)
  			klog.V(4).Infof("recycler event received: %s %s/%s %s/%s %s", event.Type, podEvent.Namespace, podEvent.Name, podEvent.InvolvedObject.Namespace, podEvent.InvolvedObject.Name, podEvent.Message)
  			if event.Type == watch.Added {
  				recyclerClient.Event(podEvent.Type, podEvent.Message)
  			}
  		}
  	}
  }
docs: // waitForPod watches the pod it until it finishes and send all events on the
  // pod to the PV.