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