當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。