func (ec *ephemeralController) syncHandler(key string) error {
	namespace, name, err := kcache.SplitMetaNamespaceKey(key)
	if err != nil {
		return err
	}
	pod, err := ec.podLister.Pods(namespace).Get(name)
	if err != nil {
		if errors.IsNotFound(err) {
			klog.V(5).Infof("ephemeral: nothing to do for pod %s, it is gone", key)
			return nil
		}
		klog.V(5).Infof("Error getting pod %s/%s (uid: %q) from informer : %v", pod.Namespace, pod.Name, pod.UID, err)
		return err
	}

	// Ignore pods which are already getting deleted.
	if pod.DeletionTimestamp != nil {
		klog.V(5).Infof("ephemeral: nothing to do for pod %s, it is marked for deletion", key)
		return nil
	}

	for _, vol := range pod.Spec.Volumes {
		if err := ec.handleVolume(pod, vol); err != nil {
			ec.recorder.Event(pod, v1.EventTypeWarning, events.FailedBinding, fmt.Sprintf("ephemeral volume %s: %v", vol.Name, err))
			return fmt.Errorf("pod %s, ephemeral volume %s: %v", key, vol.Name, err)
		}
	}

	return nil
}
// syncHandler is invoked for each pod which might need to be processed.
// If an error is returned from this function, the pod will be requeued.
syncHandler is invoked for each pod which might need to be processed.
If an error is returned from this function, the pod will be requeued.
// syncHandler is invoked for each pod which might need to be processed . // If an error is returned from this function the pod will be requeued .
func (ec *ephemeralController) syncHandler(key string) error {
	namespace, name, err := kcache.SplitMetaNamespaceKey(key)
	if err != nil {
		return err
	}
	pod, err := ec.podLister.Pods(namespace).Get(name)
	if err != nil {
		if errors.IsNotFound(err) {
			klog.V(5).Infof("ephemeral: nothing to do for pod %s, it is gone", key)
			return nil
		}
		klog.V(5).Infof("Error getting pod %s/%s (uid: %q) from informer : %v", pod.Namespace, pod.Name, pod.UID, err)
		return err
	}
	if pod.DeletionTimestamp != nil {
		klog.V(5).Infof("ephemeral: nothing to do for pod %s, it is marked for deletion", key)
		return nil
	}
	for _, vol := range pod.Spec.Volumes {
		if err := ec.handleVolume(pod, vol); err != nil {
			ec.recorder.Event(pod, v1.EventTypeWarning, events.FailedBinding, fmt.Sprintf("ephemeral volume %s: %v", vol.Name, err))
			return fmt.Errorf("pod %s, ephemeral volume %s: %v", key, vol.Name, err)
		}
	}
	return nil
}
func ( ec * ephemeralController ) syncHandler ( key string ) error { namespace , name , err := kcache . SplitMetaNamespaceKey ( key ) if err != nil { return err } pod , err := ec . podLister . Pods ( namespace ) . Get ( name ) if err != nil { if errors . IsNotFound ( err ) { klog . V ( 5 ) . Infof ( " " , key ) return nil } klog . V ( 5 ) . Infof ( " " , pod . Namespace , pod . Name , pod . UID , err ) return err } if pod . DeletionTimestamp != nil { klog . V ( 5 ) . Infof ( " " , key ) return nil } for _ , vol := range pod . Spec . Volumes { if err := ec . handleVolume ( pod , vol ) ; err != nil { ec . recorder . Event ( pod , v1 . EventTypeWarning , events . FailedBinding , fmt . Sprintf ( " " , vol . Name , err ) ) return fmt . Errorf ( " " , key , vol . Name , err ) } } return nil }
syncHandler is invoked for each pod which might need to be processed.
syncHandler is invoked for each pod which might need to be processed .
// Ignore pods which are already getting deleted.