code: func (ctrl *PersistentVolumeController) updateVolumePhase(volume *v1.PersistentVolume, phase v1.PersistentVolumePhase, message string) (*v1.PersistentVolume, error) {
  	klog.V(4).Infof("updating PersistentVolume[%s]: set phase %s", volume.Name, phase)
  	if volume.Status.Phase == phase {
  		// Nothing to do.
  		klog.V(4).Infof("updating PersistentVolume[%s]: phase %s already set", volume.Name, phase)
  		return volume, nil
  	}
  
  	volumeClone := volume.DeepCopy()
  	volumeClone.Status.Phase = phase
  	volumeClone.Status.Message = message
  
  	newVol, err := ctrl.kubeClient.CoreV1().PersistentVolumes().UpdateStatus(volumeClone)
  	if err != nil {
  		klog.V(4).Infof("updating PersistentVolume[%s]: set phase %s failed: %v", volume.Name, phase, err)
  		return newVol, err
  	}
  	_, err = ctrl.storeVolumeUpdate(newVol)
  	if err != nil {
  		klog.V(4).Infof("updating PersistentVolume[%s]: cannot update internal cache: %v", volume.Name, err)
  		return newVol, err
  	}
  	klog.V(2).Infof("volume %q entered phase %q", volume.Name, phase)
  	return newVol, err
  }
docs: // updateVolumePhase saves new volume phase to API server.