func getVolumeIDFromGlobalMount(host volume.VolumeHost, globalPath string) (string, error) { basePath := path.Join(host.GetPluginDir(awsElasticBlockStorePluginName), "mounts") rel, err := filepath.Rel(basePath, globalPath) if err != nil { return "", err } if strings.Contains(rel, "../") { return "", fmt.Errorf("Unexpected mount path: " + globalPath) } // Reverse the :// replacement done in makeGlobalPDPath volumeID := rel if strings.HasPrefix(volumeID, "aws/") { volumeID = strings.Replace(volumeID, "aws/", "aws://", 1) } glog.V(2).Info("Mapping mount dir ", globalPath, " to volumeID ", volumeID) return volumeID, nil }
func makeGlobalPDName(host volume.VolumeHost, devName string) string { return path.Join(host.GetPluginDir(cinderVolumePluginName), "mounts", devName) }
func makeGlobalPDPath(host volume.VolumeHost, devName string) string { return path.Join(host.GetPluginDir(photonPersistentDiskPluginName), mount.MountsInGlobalPDPath, devName) }
func makeGlobalPDPath(host volume.VolumeHost, volumeID string) string { // Clean up the URI to be more fs-friendly name := volumeID name = strings.Replace(name, "://", "/", -1) return path.Join(host.GetPluginDir(awsElasticBlockStorePluginName), "mounts", name) }
// make a directory like /var/lib/kubelet/plugins/kubernetes.io/pod/rbd/pool-image-image func makePDNameInternal(host volume.VolumeHost, pool string, image string) string { return path.Join(host.GetPluginDir(rbdPluginName), "rbd", pool+"-image-"+image) }
// make a directory like /var/lib/kubelet/plugins/kubernetes.io/pod/fc/target-lun-0 func makePDNameInternal(host volume.VolumeHost, wwns []string, lun string) string { return path.Join(host.GetPluginDir(fcPluginName), wwns[0]+"-lun-"+lun) }
func getFakeDeviceName(host volume.VolumeHost, pdName string) string { return path.Join(host.GetPluginDir(cinderVolumePluginName), "device", pdName) }
func makeGlobalPDPath(host volume.VolumeHost, volumeID aws.KubernetesVolumeID) string { // Clean up the URI to be more fs-friendly name := string(volumeID) name = strings.Replace(name, "://", "/", -1) return path.Join(host.GetPluginDir(awsElasticBlockStorePluginName), mount.MountsInGlobalPDPath, name) }
func makeGlobalPDName(host volume.VolumeHost, devName string) string { return path.Join(host.GetPluginDir(gcePersistentDiskPluginName), "mounts", devName) }
func makeGlobalPDPath(host volume.VolumeHost, volume string) string { return path.Join(host.GetPluginDir(azureDataDiskPluginName), mount.MountsInGlobalPDPath, volume) }
func makeGlobalPDPath(host volume.VolumeHost, devName string) string { return path.Join(host.GetPluginDir(vsphereVolumePluginName), "mounts", devName) }
// make a directory like /var/lib/kubelet/plugins/kubernetes.io/iscsi/portal-some_iqn-lun-lun_id func makePDNameInternal(host volume.VolumeHost, portal string, iqn string, lun string) string { return path.Join(host.GetPluginDir(iscsiPluginName), portal+"-"+iqn+"-lun-"+lun) }
func getFakeDeviceName(host volume.VolumeHost, volPath string) string { return path.Join(host.GetPluginDir(vsphereVolumePluginName), "device", volPath) }