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


Golang util.EscapeQualifiedNameForDisk函數代碼示例

本文整理匯總了Golang中k8s/io/kubernetes/pkg/util.EscapeQualifiedNameForDisk函數的典型用法代碼示例。如果您正苦於以下問題:Golang EscapeQualifiedNameForDisk函數的具體用法?Golang EscapeQualifiedNameForDisk怎麽用?Golang EscapeQualifiedNameForDisk使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


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

示例1: getMetaDir

func (b *flockerBuilder) getMetaDir() string {
	return path.Join(
		b.plugin.host.GetPodPluginDir(
			b.flocker.pod.UID, util.EscapeQualifiedNameForDisk(flockerPluginName),
		),
		b.datasetName,
	)
}
開發者ID:johnmccawley,項目名稱:origin,代碼行數:8,代碼來源:plugin.go

示例2: GetPath

func (iscsi *iscsiDisk) GetPath() string {
	name := iscsiPluginName
	// safe to use PodVolumeDir now: volume teardown occurs before pod is cleaned up
	return iscsi.plugin.host.GetPodVolumeDir(iscsi.podUID, util.EscapeQualifiedNameForDisk(name), iscsi.volName)
}
開發者ID:johndmulhausen,項目名稱:kubernetes,代碼行數:5,代碼來源:iscsi.go

示例3: GetPath

// GatePath creates global mount path
func (cephfsVolume *cephfs) GetPath() string {
	name := cephfsPluginName
	return cephfsVolume.plugin.host.GetPodVolumeDir(cephfsVolume.podUID, util.EscapeQualifiedNameForDisk(name), cephfsVolume.volName)
}
開發者ID:pologood,項目名稱:kubernetes,代碼行數:5,代碼來源:cephfs.go

示例4: GetPath

func (d *downwardAPIVolume) GetPath() string {
	return d.plugin.host.GetPodVolumeDir(d.podUID, util.EscapeQualifiedNameForDisk(downwardAPIPluginName), d.volName)
}
開發者ID:rrouf,項目名稱:kubernetes,代碼行數:3,代碼來源:downwardapi.go

示例5: 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, util.EscapeQualifiedNameForDisk(name), f.volName)
}
開發者ID:yashodhank,項目名稱:hypernetes,代碼行數:5,代碼來源:flexvolume.go

示例6: GetPath

func GetPath(uid types.UID, volName string, host volume.VolumeHost) string {
	name := emptyDirPluginName
	return host.GetPodVolumeDir(uid, util.EscapeQualifiedNameForDisk(name), volName)
}
開發者ID:erinboyd,項目名稱:origin,代碼行數:4,代碼來源:empty_dir.go

示例7: GetPath

func (d *awsElasticBlockStoreDeleter) GetPath() string {
	name := awsElasticBlockStorePluginName
	return d.plugin.host.GetPodVolumeDir(d.podUID, util.EscapeQualifiedNameForDisk(name), d.volName)
}
開發者ID:johndmulhausen,項目名稱:kubernetes,代碼行數:4,代碼來源:aws_ebs.go

示例8: GetPath

func (nfsVolume *nfs) GetPath() string {
	name := nfsPluginName
	return nfsVolume.plugin.host.GetPodVolumeDir(nfsVolume.pod.UID, util.EscapeQualifiedNameForDisk(name), nfsVolume.volName)
}
開發者ID:bgrant0607,項目名稱:kubernetes,代碼行數:4,代碼來源:nfs.go

示例9: getMetaDir

func (m *metadataVolume) getMetaDir() string {
	return path.Join(m.plugin.host.GetPodPluginDir(m.pod.UID, util.EscapeQualifiedNameForDisk(metadataPluginName)), m.volName)
}
開發者ID:MarWestermann,項目名稱:gofabric8,代碼行數:3,代碼來源:metadata.go

示例10: GetPath

func (m *metadataVolume) GetPath() string {
	return m.plugin.host.GetPodVolumeDir(m.pod.UID, util.EscapeQualifiedNameForDisk(metadataPluginName), m.volName)
}
開發者ID:MarWestermann,項目名稱:gofabric8,代碼行數:3,代碼來源:metadata.go

示例11: GetPath

func (fv *FakeVolume) GetPath() string {
	return path.Join(fv.Plugin.Host.GetPodVolumeDir(fv.PodUID, util.EscapeQualifiedNameForDisk(fv.Plugin.PluginName), fv.VolName))
}
開發者ID:fwalker,項目名稱:dashboard,代碼行數:3,代碼來源:testing.go

示例12: TestNewBuilder

func TestNewBuilder(t *testing.T) {
	tests := []struct {
		pv              *api.PersistentVolume
		claim           *api.PersistentVolumeClaim
		plugin          volume.VolumePlugin
		podVolume       api.VolumeSource
		testFunc        func(builder volume.Builder, plugin volume.VolumePlugin) error
		expectedFailure bool
	}{
		{
			pv: &api.PersistentVolume{
				ObjectMeta: api.ObjectMeta{
					Name: "pvA",
				},
				Spec: api.PersistentVolumeSpec{
					PersistentVolumeSource: api.PersistentVolumeSource{
						GCEPersistentDisk: &api.GCEPersistentDiskVolumeSource{},
					},
					ClaimRef: &api.ObjectReference{
						Name: "claimA",
					},
				},
			},
			claim: &api.PersistentVolumeClaim{
				ObjectMeta: api.ObjectMeta{
					Name:      "claimA",
					Namespace: "nsA",
				},
				Spec: api.PersistentVolumeClaimSpec{
					VolumeName: "pvA",
				},
				Status: api.PersistentVolumeClaimStatus{
					Phase: api.ClaimBound,
				},
			},
			podVolume: api.VolumeSource{
				PersistentVolumeClaim: &api.PersistentVolumeClaimVolumeSource{
					ReadOnly:  false,
					ClaimName: "claimA",
				},
			},
			plugin: gce_pd.ProbeVolumePlugins()[0],
			testFunc: func(builder volume.Builder, plugin volume.VolumePlugin) error {
				if !strings.Contains(builder.GetPath(), util.EscapeQualifiedNameForDisk(plugin.Name())) {
					return fmt.Errorf("builder path expected to contain plugin name.  Got: %s", builder.GetPath())
				}
				return nil
			},
			expectedFailure: false,
		},
		{
			pv: &api.PersistentVolume{
				ObjectMeta: api.ObjectMeta{
					Name: "pvB",
				},
				Spec: api.PersistentVolumeSpec{
					PersistentVolumeSource: api.PersistentVolumeSource{
						HostPath: &api.HostPathVolumeSource{Path: "/tmp"},
					},
					ClaimRef: &api.ObjectReference{
						Name: "claimB",
					},
				},
			},
			claim: &api.PersistentVolumeClaim{
				ObjectMeta: api.ObjectMeta{
					Name:      "claimB",
					Namespace: "nsB",
				},
				Spec: api.PersistentVolumeClaimSpec{
					VolumeName: "pvA",
				},
			},
			podVolume: api.VolumeSource{
				PersistentVolumeClaim: &api.PersistentVolumeClaimVolumeSource{
					ReadOnly:  false,
					ClaimName: "claimB",
				},
			},
			plugin: host_path.ProbeVolumePlugins(nil)[0],
			testFunc: func(builder volume.Builder, plugin volume.VolumePlugin) error {
				if builder.GetPath() != "/tmp" {
					return fmt.Errorf("Expected HostPath.Path /tmp, got: %s", builder.GetPath())
				}
				return nil
			},
			expectedFailure: false,
		},
		{
			pv: &api.PersistentVolume{
				ObjectMeta: api.ObjectMeta{
					Name: "pvA",
				},
				Spec: api.PersistentVolumeSpec{
					PersistentVolumeSource: api.PersistentVolumeSource{
						GCEPersistentDisk: &api.GCEPersistentDiskVolumeSource{},
					},
				},
			},
			claim: &api.PersistentVolumeClaim{
//.........這裏部分代碼省略.........
開發者ID:MarWestermann,項目名稱:gofabric8,代碼行數:101,代碼來源:persistent_claim_test.go

示例13: 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, util.EscapeQualifiedNameForDisk(name), rbd.volName)
}
開發者ID:MarWestermann,項目名稱:gofabric8,代碼行數:5,代碼來源:rbd.go

示例14: GetPath

func (d *gcePersistentDiskDeleter) GetPath() string {
	name := gcePersistentDiskPluginName
	return d.plugin.host.GetPodVolumeDir(d.podUID, util.EscapeQualifiedNameForDisk(name), d.volName)
}
開發者ID:johnmccawley,項目名稱:origin,代碼行數:4,代碼來源:gce_pd.go

示例15: GetPath

func (fc *fcDisk) GetPath() string {
	name := fcPluginName
	// safe to use PodVolumeDir now: volume teardown occurs before pod is cleaned up
	return fc.plugin.host.GetPodVolumeDir(fc.podUID, util.EscapeQualifiedNameForDisk(name), fc.volName)
}
開發者ID:robbfoster-taulia,項目名稱:kubernetes,代碼行數:5,代碼來源:fc.go


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