本文整理汇总了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
}
示例2: getMetaDir
func (b *flockerBuilder) getMetaDir() string {
return path.Join(
b.plugin.host.GetPodPluginDir(
b.flocker.pod.UID, strings.EscapeQualifiedNameForDisk(flockerPluginName),
),
b.datasetName,
)
}
示例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))
}
示例4: GetPath
func (vv *vsphereVolume) GetPath() string {
name := vsphereVolumePluginName
return vv.plugin.host.GetPodVolumeDir(vv.podUID, utilstrings.EscapeQualifiedNameForDisk(name), vv.volName)
}
示例5: GetPath
func (r *cinderVolumeDeleter) GetPath() string {
name := cinderVolumePluginName
return r.plugin.host.GetPodVolumeDir(r.podUID, strings.EscapeQualifiedNameForDisk(name), r.volName)
}
示例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)
}
示例7: GetPath
func (ppd *photonPersistentDisk) GetPath() string {
name := photonPersistentDiskPluginName
return ppd.plugin.host.GetPodVolumeDir(ppd.podUID, utilstrings.EscapeQualifiedNameForDisk(name), ppd.volName)
}
示例8: getPath
func (fv *FakeVolume) getPath() string {
return path.Join(fv.Plugin.Host.GetPodVolumeDir(fv.PodUID, utilstrings.EscapeQualifiedNameForDisk(fv.Plugin.PluginName), fv.VolName))
}
示例9: GetPath
func (d *downwardAPIVolume) GetPath() string {
return d.plugin.host.GetPodVolumeDir(d.podUID, utilstrings.EscapeQualifiedNameForDisk(downwardAPIPluginName), d.volName)
}
示例10: GetPath
func (azureFileVolume *azureFile) GetPath() string {
name := azureFilePluginName
return azureFileVolume.plugin.host.GetPodVolumeDir(azureFileVolume.pod.UID, strings.EscapeQualifiedNameForDisk(name), azureFileVolume.volName)
}
示例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)
}
示例12: GetPath
func (d *gcePersistentDiskDeleter) GetPath() string {
name := gcePersistentDiskPluginName
return d.plugin.host.GetPodVolumeDir(d.podUID, strings.EscapeQualifiedNameForDisk(name), d.volName)
}
示例13: GetPath
func (gr *gitRepoVolume) GetPath() string {
name := gitRepoPluginName
return gr.plugin.host.GetPodVolumeDir(gr.podUID, utilstrings.EscapeQualifiedNameForDisk(name), gr.volName)
}
示例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)
}
示例15: GetPath
func (azure *azureDisk) GetPath() string {
name := azureDataDiskPluginName
return azure.plugin.host.GetPodVolumeDir(azure.podUID, utilstrings.EscapeQualifiedNameForDisk(name), azure.volName)
}