当前位置: 首页>>代码示例>>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;未经允许,请勿转载。