本文整理汇总了Golang中github.com/openshift/origin/test/extended/util.GetDockerImageReference函数的典型用法代码示例。如果您正苦于以下问题:Golang GetDockerImageReference函数的具体用法?Golang GetDockerImageReference怎么用?Golang GetDockerImageReference使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetDockerImageReference函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1:
g.By("starting the sample source build")
out, err := oc.Run("start-build").Args("test", "--follow", "--wait").Output()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(out).To(o.ContainSubstring("secret1=secret1"))
o.Expect(out).To(o.ContainSubstring("secret3=secret3"))
o.Expect(out).To(o.ContainSubstring("relative-secret1=secret1"))
o.Expect(out).To(o.ContainSubstring("relative-secret3=secret3"))
g.By("checking the status of the build")
build, err := oc.REST().Builds(oc.Namespace()).Get("test-1")
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(build.Status.Phase).Should(o.BeEquivalentTo(buildapi.BuildPhaseComplete))
g.By("getting the image name")
image, err := exutil.GetDockerImageReference(oc.REST().ImageStreams(oc.Namespace()), "test", "latest")
o.Expect(err).NotTo(o.HaveOccurred())
g.By("verifying the build secrets are not present in the output image")
pod := exutil.GetPodForContainer(kapi.Container{Name: "test", Image: image})
oc.KubeFramework().TestContainerOutput("test-build-secret-source", pod, 0, []string{
"relative-secret1=empty",
"secret3=empty",
})
})
g.It("should print the secrets during the docker strategy build", func() {
g.By("creating the sample secret files")
err := oc.Run("create").Args("-f", secretsFixture).Execute()
o.Expect(err).NotTo(o.HaveOccurred())
err = oc.Run("create").Args("-f", secondSecretsFixture).Execute()
开发者ID:grs,项目名称:origin,代码行数:30,代码来源:secrets.go
示例2:
oc.SetOutputDir(exutil.TestContext.OutputDir)
g.By(fmt.Sprintf("calling oc create -f %q", imageStreamFixture))
err := oc.Run("create").Args("-f", imageStreamFixture).Execute()
o.Expect(err).NotTo(o.HaveOccurred())
g.By(fmt.Sprintf("calling oc create -f %q", stiBuildFixture))
err = oc.Run("create").Args("-f", stiBuildFixture).Execute()
o.Expect(err).NotTo(o.HaveOccurred())
g.By("starting a test build")
br, err := exutil.StartBuildAndWait(oc, "test")
br.AssertSuccess()
g.By("getting the Docker image reference from ImageStream")
imageRef, err := exutil.GetDockerImageReference(oc.Client().ImageStreams(oc.Namespace()), "test", "latest")
o.Expect(err).NotTo(o.HaveOccurred())
imageLabels, err := eximages.GetImageLabels(oc.Client().ImageStreamImages(oc.Namespace()), "test", imageRef)
o.Expect(err).NotTo(o.HaveOccurred())
g.By("inspecting the new image for proper Docker labels")
err = ExpectOpenShiftLabels(imageLabels)
o.Expect(err).NotTo(o.HaveOccurred())
})
})
g.Describe("Docker build from a template", func() {
g.It(fmt.Sprintf("should create a image from %q template with proper Docker labels", dockerBuildFixture), func() {
oc.SetOutputDir(exutil.TestContext.OutputDir)
开发者ID:LalatenduMohanty,项目名称:origin,代码行数:30,代码来源:labels.go
注:本文中的github.com/openshift/origin/test/extended/util.GetDockerImageReference函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论