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


Golang ImageTagLocation.ImageSpec方法代码示例

本文整理汇总了Golang中github.com/openshift/origin/pkg/api/graph/graphview.ImageTagLocation.ImageSpec方法的典型用法代码示例。如果您正苦于以下问题:Golang ImageTagLocation.ImageSpec方法的具体用法?Golang ImageTagLocation.ImageSpec怎么用?Golang ImageTagLocation.ImageSpec使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/openshift/origin/pkg/api/graph/graphview.ImageTagLocation的用法示例。


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

示例1: describeBuildInPipeline

func describeBuildInPipeline(f formatter, build *buildapi.BuildConfig, baseImage graphview.ImageTagLocation) string {
	switch {
	case build.Spec.Strategy.DockerStrategy != nil:
		// TODO: handle case where no source repo
		source, ok := describeSourceInPipeline(&build.Spec.Source)
		if !ok {
			return fmt.Sprintf("bc/%s unconfigured docker build - no source set", build.Name)
		}
		return fmt.Sprintf("bc/%s docker build of %s", build.Name, source)
	case build.Spec.Strategy.SourceStrategy != nil:
		source, ok := describeSourceInPipeline(&build.Spec.Source)
		if !ok {
			return fmt.Sprintf("bc/%s unconfigured source build", build.Name)
		}
		if baseImage == nil {
			return fmt.Sprintf("bc/%s %s; no image set", build.Name, source)
		}
		return fmt.Sprintf("bc/%s builds %s with %s", build.Name, source, baseImage.ImageSpec())
	case build.Spec.Strategy.CustomStrategy != nil:
		source, ok := describeSourceInPipeline(&build.Spec.Source)
		if !ok {
			return fmt.Sprintf("bc/%s custom build ", build.Name)
		}
		return fmt.Sprintf("bc/%s custom build of %s", build.Name, source)
	default:
		return fmt.Sprintf("bc/%s unrecognized build", build.Name)
	}
}
开发者ID:iconoeugen,项目名称:origin,代码行数:28,代码来源:projectstatus.go

示例2: describeBuildInPipeline

func describeBuildInPipeline(build *buildapi.BuildConfig, baseImage graphview.ImageTagLocation) string {
	switch build.Spec.Strategy.Type {
	case buildapi.DockerBuildStrategyType:
		// TODO: handle case where no source repo
		source, ok := describeSourceInPipeline(&build.Spec.Source)
		if !ok {
			return "docker build; no source set"
		}
		return fmt.Sprintf("docker build of %s", source)
	case buildapi.SourceBuildStrategyType:
		source, ok := describeSourceInPipeline(&build.Spec.Source)
		if !ok {
			return fmt.Sprintf("unconfigured source build %s", build.Name)
		}
		if baseImage == nil {
			return fmt.Sprintf("%s; no image set", source)
		}
		return fmt.Sprintf("builds %s with %s", source, baseImage.ImageSpec())
	case buildapi.CustomBuildStrategyType:
		source, ok := describeSourceInPipeline(&build.Spec.Source)
		if !ok {
			return fmt.Sprintf("custom build %s", build.Name)
		}
		return fmt.Sprintf("custom build of %s", source)
	default:
		return fmt.Sprintf("unrecognized build %s", build.Name)
	}
}
开发者ID:heriipurnama,项目名称:origin,代码行数:28,代码来源:projectstatus.go

示例3: describeImageTagInPipeline

func describeImageTagInPipeline(f formatter, image graphview.ImageTagLocation, namespace string) string {
	switch t := image.(type) {
	case *imagegraph.ImageStreamTagNode:
		if t.ImageStreamTag.Namespace != namespace {
			return image.ImageSpec()
		}
		return f.ResourceName(t)
	default:
		return image.ImageSpec()
	}
}
开发者ID:iconoeugen,项目名称:origin,代码行数:11,代码来源:projectstatus.go

示例4: describeImageTagInPipeline

func describeImageTagInPipeline(image graphview.ImageTagLocation, namespace string) string {
	switch t := image.(type) {
	case *imagegraph.ImageStreamTagNode:
		if t.ImageStreamTag.Namespace != namespace {
			return image.ImageSpec()
		}
		return "istag/" + t.ImageStreamTag.Name
	default:
		return image.ImageSpec()
	}
}
开发者ID:Tlacenka,项目名称:origin,代码行数:11,代码来源:projectstatus.go


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