当前位置: 首页>>代码示例>>Golang>>正文


Golang strings.EscapeQualifiedNameForDisk函数代码示例

本文整理汇总了Golang中k8s/io/kubernetes/pkg/util/strings.EscapeQualifiedNameForDisk函数的典型用法代码示例。如果您正苦于以下问题:Golang EscapeQualifiedNameForDisk函数的具体用法?Golang EscapeQualifiedNameForDisk怎么用?Golang EscapeQualifiedNameForDisk使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了EscapeQualifiedNameForDisk函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: CanSupport

func (plugin *quobytePlugin) CanSupport(spec *volume.Spec) bool {
	if (spec.PersistentVolume != nil && spec.PersistentVolume.Spec.Quobyte == nil) ||
		(spec.Volume != nil && spec.Volume.Quobyte == nil) {
		return false
	}

	// If Quobyte is already mounted we don't need to check if the binary is installed
	if mounter, err := plugin.newMounterInternal(spec, nil, plugin.host.GetMounter()); err == nil {
		qm, _ := mounter.(*quobyteMounter)
		pluginDir := plugin.host.GetPluginDir(strings.EscapeQualifiedNameForDisk(quobytePluginName))
		if mounted, err := qm.pluginDirIsMounted(pluginDir); mounted && err == nil {
			glog.V(4).Infof("quobyte: can support")
			return true
		}
	} else {
		glog.V(4).Infof("quobyte: Error: %v", err)
	}

	if out, err := exec.New().Command("ls", "/sbin/mount.quobyte").CombinedOutput(); err == nil {
		glog.V(4).Infof("quobyte: can support: %s", string(out))
		return true
	}

	return false
}
开发者ID:juanluisvaladas,项目名称:origin,代码行数:25,代码来源:quobyte.go

示例2: getMetaDir

func (b *flockerBuilder) getMetaDir() string {
	return path.Join(
		b.plugin.host.GetPodPluginDir(
			b.flocker.pod.UID, strings.EscapeQualifiedNameForDisk(flockerPluginName),
		),
		b.datasetName,
	)
}
开发者ID:xiaohui,项目名称:kubernetes,代码行数:8,代码来源:plugin.go

示例3: GetPath

// GetPath returns the path to the user specific mount of a Quobyte volume
// Returns a path in the format ../[email protected] e.g. ../[email protected]
// or if a group is set ../user#[email protected]
func (quobyteVolume *quobyte) GetPath() string {
	user := quobyteVolume.user
	if len(user) == 0 {
		user = "root"
	}

	// Quobyte has only one mount in the PluginDir where all Volumes are mounted
	// The Quobyte client does a fixed-user mapping
	pluginDir := quobyteVolume.plugin.host.GetPluginDir(strings.EscapeQualifiedNameForDisk(quobytePluginName))
	if len(quobyteVolume.group) > 0 {
		return path.Join(pluginDir, fmt.Sprintf("%s#%[email protected]%s", user, quobyteVolume.group, quobyteVolume.volume))
	}

	return path.Join(pluginDir, fmt.Sprintf("%[email protected]%s", user, quobyteVolume.volume))
}
开发者ID:juanluisvaladas,项目名称:origin,代码行数:18,代码来源:quobyte.go

示例4: GetPath

func (vv *vsphereVolume) GetPath() string {
	name := vsphereVolumePluginName
	return vv.plugin.host.GetPodVolumeDir(vv.podUID, utilstrings.EscapeQualifiedNameForDisk(name), vv.volName)
}
开发者ID:FlyWings,项目名称:kubernetes,代码行数:4,代码来源:vsphere_volume.go

示例5: GetPath

func (r *cinderVolumeDeleter) GetPath() string {
	name := cinderVolumePluginName
	return r.plugin.host.GetPodVolumeDir(r.podUID, strings.EscapeQualifiedNameForDisk(name), r.volName)
}
开发者ID:ncdc,项目名称:origin,代码行数:4,代码来源:cinder.go

示例6: GetPath

func (rbd *rbd) GetPath() string {
	name := rbdPluginName
	// safe to use PodVolumeDir now: volume teardown occurs before pod is cleaned up
	return rbd.plugin.host.GetPodVolumeDir(rbd.podUID, strings.EscapeQualifiedNameForDisk(name), rbd.volName)
}
开发者ID:thed00de,项目名称:hypernetes,代码行数:5,代码来源:rbd.go

示例7: GetPath

func (ppd *photonPersistentDisk) GetPath() string {
	name := photonPersistentDiskPluginName
	return ppd.plugin.host.GetPodVolumeDir(ppd.podUID, utilstrings.EscapeQualifiedNameForDisk(name), ppd.volName)
}
开发者ID:jonboulle,项目名称:kubernetes,代码行数:4,代码来源:photon_pd.go

示例8: getPath

func (fv *FakeVolume) getPath() string {
	return path.Join(fv.Plugin.Host.GetPodVolumeDir(fv.PodUID, utilstrings.EscapeQualifiedNameForDisk(fv.Plugin.PluginName), fv.VolName))
}
开发者ID:FlyWings,项目名称:kubernetes,代码行数:3,代码来源:testing.go

示例9: GetPath

func (d *downwardAPIVolume) GetPath() string {
	return d.plugin.host.GetPodVolumeDir(d.podUID, utilstrings.EscapeQualifiedNameForDisk(downwardAPIPluginName), d.volName)
}
开发者ID:Cloven,项目名称:minikube,代码行数:3,代码来源:downwardapi.go

示例10: GetPath

func (azureFileVolume *azureFile) GetPath() string {
	name := azureFilePluginName
	return azureFileVolume.plugin.host.GetPodVolumeDir(azureFileVolume.pod.UID, strings.EscapeQualifiedNameForDisk(name), azureFileVolume.volName)
}
开发者ID:thed00de,项目名称:hypernetes,代码行数:4,代码来源:azure_file.go

示例11: GetPath

// GatePath creates global mount path
func (cephfsVolume *cephfs) GetPath() string {
	name := cephfsPluginName
	return cephfsVolume.plugin.host.GetPodVolumeDir(cephfsVolume.podUID, utilstrings.EscapeQualifiedNameForDisk(name), cephfsVolume.volName)
}
开发者ID:40a,项目名称:bootkube,代码行数:5,代码来源:cephfs.go

示例12: GetPath

func (d *gcePersistentDiskDeleter) GetPath() string {
	name := gcePersistentDiskPluginName
	return d.plugin.host.GetPodVolumeDir(d.podUID, strings.EscapeQualifiedNameForDisk(name), d.volName)
}
开发者ID:ipbabble,项目名称:kubernetes,代码行数:4,代码来源:gce_pd.go

示例13: GetPath

func (gr *gitRepoVolume) GetPath() string {
	name := gitRepoPluginName
	return gr.plugin.host.GetPodVolumeDir(gr.podUID, utilstrings.EscapeQualifiedNameForDisk(name), gr.volName)
}
开发者ID:ncdc,项目名称:kubernetes,代码行数:4,代码来源:git_repo.go

示例14: GetPath

// GetPathFromPlugin gets the actual volume mount directory based on plugin.
func (f *flexVolumeDisk) GetPath() string {
	name := f.driverName
	return f.plugin.host.GetPodVolumeDir(f.podUID, utilstrings.EscapeQualifiedNameForDisk(name), f.volName)
}
开发者ID:jojimt,项目名称:contrib,代码行数:5,代码来源:flexvolume.go

示例15: GetPath

func (azure *azureDisk) GetPath() string {
	name := azureDataDiskPluginName
	return azure.plugin.host.GetPodVolumeDir(azure.podUID, utilstrings.EscapeQualifiedNameForDisk(name), azure.volName)
}
开发者ID:Q-Lee,项目名称:kubernetes,代码行数:4,代码来源:azure_dd.go


注:本文中的k8s/io/kubernetes/pkg/util/strings.EscapeQualifiedNameForDisk函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。