func()

in pkg/csi/node.go [88:105]


func (d *Driver) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error) {
	if len(req.GetTargetPath()) == 0 {
		return nil, status.Error(codes.InvalidArgument, "Target path missing in request")
	}

	mounter := &mount.SafeFormatAndMount{
		Interface: mount.New(""),
		Exec:      exec.New(),
	}
	err := mounter.Interface.Unmount(req.GetTargetPath())
	if err != nil {
		return nil, status.Errorf(codes.Internal, "Unmount of bind mount at %s failed: %v", req.GetTargetPath(), err)
	}

	klog.Infof("Unmounted %s", req.GetTargetPath())

	return &csi.NodeUnpublishVolumeResponse{}, nil
}