本文整理汇总了Golang中github.com/openshift/origin/pkg/api/graph/graphview.ImageTagLocation类的典型用法代码示例。如果您正苦于以下问题:Golang ImageTagLocation类的具体用法?Golang ImageTagLocation怎么用?Golang ImageTagLocation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ImageTagLocation类的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)
}
}
示例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)
}
}
示例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()
}
}
示例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()
}
}