本文整理汇总了Golang中github.com/GoogleCloudPlatform/kubernetes/pkg/util.EscapeQualifiedNameForDisk函数的典型用法代码示例。如果您正苦于以下问题:Golang EscapeQualifiedNameForDisk函数的具体用法?Golang EscapeQualifiedNameForDisk怎么用?Golang EscapeQualifiedNameForDisk使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了EscapeQualifiedNameForDisk函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: GetPath
func (gr *gitRepo) GetPath() string {
name := gitRepoPluginName
if gr.legacyMode {
name = gitRepoPluginLegacyName
}
return gr.plugin.host.GetPodVolumeDir(gr.pod.UID, util.EscapeQualifiedNameForDisk(name), gr.volName)
}
开发者ID:chenzhen411,项目名称:kubernetes,代码行数:7,代码来源:git_repo.go
示例2: GetPath
func (ed *emptyDir) GetPath() string {
name := emptyDirPluginName
if ed.legacyMode {
name = emptyDirPluginLegacyName
}
return ed.plugin.host.GetPodVolumeDir(ed.podUID, util.EscapeQualifiedNameForDisk(name), ed.volName)
}
开发者ID:SivagnanamCiena,项目名称:calico-kubernetes,代码行数:7,代码来源:empty_dir.go
示例3: GetPath
func (pd *gcePersistentDisk) GetPath() string {
name := gcePersistentDiskPluginName
if pd.legacyMode {
name = gcePersistentDiskPluginLegacyName
}
return pd.plugin.host.GetPodVolumeDir(pd.podUID, util.EscapeQualifiedNameForDisk(name), pd.volName)
}
开发者ID:chenzhen411,项目名称:kubernetes,代码行数:7,代码来源:gce_pd.go
示例4: 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:chenzhen411,项目名称:kubernetes,代码行数:5,代码来源:iscsi.go
示例5: getMetaDir
func (gr *gitRepo) getMetaDir() string {
return path.Join(gr.plugin.host.GetPodPluginDir(gr.pod.UID, util.EscapeQualifiedNameForDisk(gitRepoPluginName)), gr.volName)
}
开发者ID:chenzhen411,项目名称:kubernetes,代码行数:3,代码来源:git_repo.go
示例6: GetPath
func (ebs *awsElasticBlockStore) GetPath() string {
name := awsElasticBlockStorePluginName
return ebs.plugin.host.GetPodVolumeDir(ebs.podUID, util.EscapeQualifiedNameForDisk(name), ebs.volName)
}
开发者ID:Ima8,项目名称:kubernetes,代码行数:4,代码来源:aws_ebs.go
示例7: GetPath
func (cephfsVolume *cephfs) GetPath() string {
name := cephfsPluginName
return cephfsVolume.plugin.host.GetPodVolumeDir(cephfsVolume.podUID, util.EscapeQualifiedNameForDisk(name), cephfsVolume.volName)
}
开发者ID:cjnygard,项目名称:origin,代码行数:4,代码来源:cephfs.go
示例8: getMetaDir
func (m *metadataVolume) getMetaDir() string {
return path.Join(m.plugin.host.GetPodPluginDir(m.pod.UID, util.EscapeQualifiedNameForDisk(metadataPluginName)), m.volName)
}
开发者ID:cjnygard,项目名称:origin,代码行数:3,代码来源:metadata.go
示例9: GetPath
func (m *metadataVolume) GetPath() string {
return m.plugin.host.GetPodVolumeDir(m.pod.UID, util.EscapeQualifiedNameForDisk(metadataPluginName), m.volName)
}
开发者ID:cjnygard,项目名称:origin,代码行数:3,代码来源:metadata.go
示例10: GetPath
func (nfsVolume *nfs) GetPath() string {
name := nfsPluginName
return nfsVolume.plugin.host.GetPodVolumeDir(nfsVolume.pod.UID, util.EscapeQualifiedNameForDisk(name), nfsVolume.volName)
}
开发者ID:gabrielweyer,项目名称:kubernetes,代码行数:4,代码来源:nfs.go
示例11: GetPath
func (ed *emptyDir) GetPath() string {
name := emptyDirPluginName
return ed.plugin.host.GetPodVolumeDir(ed.pod.UID, util.EscapeQualifiedNameForDisk(name), ed.volName)
}
开发者ID:dustintownsend,项目名称:origin,代码行数:4,代码来源:empty_dir.go
示例12: GetPath
func (sv *secretVolume) GetPath() string {
return sv.plugin.host.GetPodVolumeDir(sv.pod.UID, util.EscapeQualifiedNameForDisk(secretPluginName), sv.volName)
}
开发者ID:chenzhen411,项目名称:kubernetes,代码行数:3,代码来源:secret.go
示例13: getMetaDir
func (sv *secretVolume) getMetaDir() string {
return path.Join(sv.plugin.host.GetPodPluginDir(sv.pod.UID, util.EscapeQualifiedNameForDisk(secretPluginName)), sv.volName)
}
开发者ID:chenzhen411,项目名称:kubernetes,代码行数:3,代码来源:secret.go
示例14: GetPath
func (fv *FakeVolume) GetPath() string {
return path.Join(fv.Plugin.Host.GetPodVolumeDir(fv.PodUID, util.EscapeQualifiedNameForDisk(fv.Plugin.PluginName), fv.VolName))
}
开发者ID:SivagnanamCiena,项目名称:calico-kubernetes,代码行数:3,代码来源:testing.go
示例15: 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:chenzhen411,项目名称:kubernetes,代码行数:5,代码来源:rbd.go
示例16: GetPath
func (gr *gitRepoVolume) GetPath() string {
name := gitRepoPluginName
return gr.plugin.host.GetPodVolumeDir(gr.podUID, util.EscapeQualifiedNameForDisk(name), gr.volName)
}
开发者ID:TesterRandolph,项目名称:kubernetes,代码行数:4,代码来源:git_repo.go
示例17: getMetaDir
func (b *gitRepoVolumeBuilder) getMetaDir() string {
return path.Join(b.plugin.host.GetPodPluginDir(b.podUID, util.EscapeQualifiedNameForDisk(gitRepoPluginName)), b.volName)
}
开发者ID:TesterRandolph,项目名称:kubernetes,代码行数:3,代码来源:git_repo.go
示例18: getMetaDir
func (ed *emptyDir) getMetaDir() string {
return path.Join(ed.plugin.host.GetPodPluginDir(ed.pod.UID, util.EscapeQualifiedNameForDisk(emptyDirPluginName)), ed.volName)
}
开发者ID:dustintownsend,项目名称:origin,代码行数:3,代码来源:empty_dir.go
示例19: 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:brandon-adams,项目名称:origin,代码行数:101,代码来源:persistent_claim_test.go
示例20: GetPath
func (glusterfsVolume *glusterfs) GetPath() string {
name := glusterfsPluginName
return glusterfsVolume.plugin.host.GetPodVolumeDir(glusterfsVolume.pod.UID, util.EscapeQualifiedNameForDisk(name), glusterfsVolume.volName)
}
开发者ID:Ima8,项目名称:kubernetes,代码行数:4,代码来源:glusterfs.go
注:本文中的github.com/GoogleCloudPlatform/kubernetes/pkg/util.EscapeQualifiedNameForDisk函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论