本文整理匯總了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()
}
}