當前位置: 首頁>>代碼示例>>Golang>>正文


Golang VolumeHost.GetPluginDir方法代碼示例

本文整理匯總了Golang中k8s/io/kubernetes/pkg/volume.VolumeHost.GetPluginDir方法的典型用法代碼示例。如果您正苦於以下問題:Golang VolumeHost.GetPluginDir方法的具體用法?Golang VolumeHost.GetPluginDir怎麽用?Golang VolumeHost.GetPluginDir使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在k8s/io/kubernetes/pkg/volume.VolumeHost的用法示例。


在下文中一共展示了VolumeHost.GetPluginDir方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: getVolumeIDFromGlobalMount

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
}
開發者ID:johndmulhausen,項目名稱:kubernetes,代碼行數:17,代碼來源:aws_ebs.go

示例2: makeGlobalPDName

func makeGlobalPDName(host volume.VolumeHost, devName string) string {
	return path.Join(host.GetPluginDir(cinderVolumePluginName), "mounts", devName)
}
開發者ID:ncdc,項目名稱:origin,代碼行數:3,代碼來源:cinder.go

示例3: makeGlobalPDPath

func makeGlobalPDPath(host volume.VolumeHost, devName string) string {
	return path.Join(host.GetPluginDir(photonPersistentDiskPluginName), mount.MountsInGlobalPDPath, devName)
}
開發者ID:jonboulle,項目名稱:kubernetes,代碼行數:3,代碼來源:photon_pd.go

示例4: makeGlobalPDPath

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)
}
開發者ID:johndmulhausen,項目名稱:kubernetes,代碼行數:6,代碼來源:aws_ebs.go

示例5: makePDNameInternal

// 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)
}
開發者ID:johndmulhausen,項目名稱:kubernetes,代碼行數:4,代碼來源:rbd_util.go

示例6: makePDNameInternal

// 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)
}
開發者ID:CNDonny,項目名稱:scope,代碼行數:4,代碼來源:fc_util.go

示例7: getFakeDeviceName

func getFakeDeviceName(host volume.VolumeHost, pdName string) string {
	return path.Join(host.GetPluginDir(cinderVolumePluginName), "device", pdName)
}
開發者ID:juanluisvaladas,項目名稱:origin,代碼行數:3,代碼來源:cinder_test.go

示例8: makeGlobalPDPath

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)
}
開發者ID:alex-mohr,項目名稱:kubernetes,代碼行數:6,代碼來源:aws_ebs.go

示例9: makeGlobalPDName

func makeGlobalPDName(host volume.VolumeHost, devName string) string {
	return path.Join(host.GetPluginDir(gcePersistentDiskPluginName), "mounts", devName)
}
開發者ID:eljefedelrodeodeljefe,項目名稱:kubernetes,代碼行數:3,代碼來源:gce_pd.go

示例10: makeGlobalPDPath

func makeGlobalPDPath(host volume.VolumeHost, volume string) string {
	return path.Join(host.GetPluginDir(azureDataDiskPluginName), mount.MountsInGlobalPDPath, volume)
}
開發者ID:Q-Lee,項目名稱:kubernetes,代碼行數:3,代碼來源:azure_dd.go

示例11: makeGlobalPDPath

func makeGlobalPDPath(host volume.VolumeHost, devName string) string {
	return path.Join(host.GetPluginDir(vsphereVolumePluginName), "mounts", devName)
}
開發者ID:FlyWings,項目名稱:kubernetes,代碼行數:3,代碼來源:vsphere_volume.go

示例12: makePDNameInternal

// 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)
}
開發者ID:RyanBinfeng,項目名稱:kubernetes,代碼行數:4,代碼來源:iscsi_util.go

示例13: getFakeDeviceName

func getFakeDeviceName(host volume.VolumeHost, volPath string) string {
	return path.Join(host.GetPluginDir(vsphereVolumePluginName), "device", volPath)
}
開發者ID:FlyWings,項目名稱:kubernetes,代碼行數:3,代碼來源:vsphere_volume_test.go


注:本文中的k8s/io/kubernetes/pkg/volume.VolumeHost.GetPluginDir方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。