From 4cbb844d1d5f3a3ac6dd08325db17b807e7129f2 Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Tue, 21 Jul 2020 14:27:04 -0400 Subject: [PATCH] test: Update openshift tests to use locked images Update the references to individual images in tests to use either upstream Kube images, or the new tools image. Fix tests that had assumptions about access to those images, including custom builds which lacked access to certs and pull credentials. --- cmd/openshift-tests/images.go | 30 +- test/e2e/upgrade/alert/alert.go | 2 +- test/e2e/upgrade/monitor.go | 3 +- test/extended/apiserver/kubeconfigs.go | 2 +- test/extended/builds/contextdir.go | 3 +- test/extended/builds/dockerfile.go | 21 +- test/extended/builds/hooks.go | 4 +- test/extended/builds/multistage.go | 158 +++++----- test/extended/builds/optimized.go | 7 +- test/extended/builds/service.go | 19 +- test/extended/cli/compat.go | 48 +-- test/extended/cli/debug.go | 2 +- test/extended/csrapprover/csrapprover.go | 3 +- test/extended/deployments/deployments.go | 17 +- test/extended/etcd/etcd_storage_path.go | 4 +- test/extended/images/append.go | 15 +- test/extended/images/extract.go | 38 ++- test/extended/images/imagestreamimport.go | 3 +- test/extended/images/layers.go | 6 +- test/extended/images/mirror.go | 59 ++-- test/extended/images/oc_tag.go | 24 +- test/extended/images/resolve.go | 93 ++++-- test/extended/networking/multicast.go | 3 +- test/extended/oauth/groupsync.go | 7 +- test/extended/prometheus/prometheus.go | 26 +- test/extended/prometheus/prometheus_builds.go | 2 +- test/extended/prometheus/storage.go | 2 +- test/extended/router/config_manager.go | 14 +- test/extended/router/headers.go | 10 +- test/extended/router/metrics.go | 8 +- test/extended/router/reencrypt.go | 6 +- test/extended/router/scoped.go | 34 +-- test/extended/router/unprivileged.go | 10 +- test/extended/router/weighted.go | 14 +- test/extended/security/scc.go | 6 +- test/extended/security/supplemental_groups.go | 3 +- test/extended/testdata/bindata.go | 273 ++++++++++-------- .../application-template-custombuild.json | 2 +- .../builds/build-postcommit/docker.yaml | 2 +- .../testdata/builds/build-quota/Dockerfile | 2 +- .../testdata/builds/build-secrets/Dockerfile | 2 +- .../build-secrets/test-docker-build.json | 2 +- .../builds/build-secrets/test-s2i-build.json | 2 +- .../build-timing/test-docker-build.json | 2 +- .../builds/custom-build/Dockerfile.sample | 2 +- .../testdata/builds/custom-build/build.sh | 17 +- .../testdata/builds/docker-add/Dockerfile | 2 +- .../builds/incremental-auth-build.json | 2 +- .../builds/pullsecret/linked-nodejs-bc.yaml | 2 +- .../builds/statusfail-badcontextdirs2i.yaml | 2 +- .../statusfail-fetchimagecontentdocker.yaml | 2 +- .../builds/statusfail-fetchsourcedocker.yaml | 2 +- .../builds/statusfail-fetchsources2i.yaml | 2 +- .../builds/statusfail-genericreason.yaml | 2 +- .../testdata/builds/statusfail-oomkilled.yaml | 2 +- .../testdata/builds/test-build-proxy.yaml | 2 +- test/extended/testdata/builds/test-build.yaml | 14 +- .../testdata/builds/test-cds-dockerbuild.json | 4 +- .../testdata/builds/test-cds-sourcebuild.json | 4 +- .../testdata/builds/test-context-build.json | 2 +- .../builds/test-docker-build-pullsecret.json | 6 +- .../testdata/builds/test-docker-build.json | 4 +- .../builds/test-docker-no-outputname.json | 4 +- .../testdata/builds/test-env-build.json | 2 +- .../testdata/cli/pod-with-two-containers.yaml | 4 +- .../testdata/cmd/test/cmd/basicresources.sh | 6 +- .../testdata/cmd/test/cmd/deployments.sh | 6 +- test/extended/testdata/cmd/test/cmd/status.sh | 4 +- .../application-template-custombuild.json | 2 +- .../application-template-dockerbuild.json | 2 +- .../application-template-stibuild.json | 2 +- .../testdata/hello-openshift/hello-pod.json | 3 +- .../cmd/test/cmd/testdata/idling-dc.yaml | 4 +- .../test/cmd/testdata/mixed-api-versions.yaml | 2 +- .../cmd/testdata/rollingupdate-daemonset.yaml | 3 +- .../templateinstance_objectkinds.yaml | 2 +- .../templates/template-type-precision.json | 2 +- .../cmd/testdata/test-deployment-config.yaml | 2 +- .../test/cmd/testdata/test-docker-build.json | 4 +- .../testdata/test-replication-controller.yaml | 2 +- .../testdata/cmd/test/cmd/triggers.sh | 10 +- .../config-map-jenkins-slave-pods.yaml | 2 +- .../deployments/custom-deployment.yaml | 2 +- .../deployments/deployment-history-limit.yaml | 2 +- .../deployment-ignores-deployer.yaml | 2 +- .../deployment-image-resolution-is.yaml | 4 +- .../deployment-min-ready-seconds.yaml | 2 +- .../deployments/deployment-simple.yaml | 2 +- .../deployments/deployment-with-ref-env.yaml | 2 +- .../deployments/failing-pre-hook.yaml | 2 +- .../testdata/deployments/generation-test.yaml | 2 +- .../deployments/paused-deployment.yaml | 2 +- .../testdata/deployments/readiness-test.yaml | 2 +- .../deployments/tag-images-deployment.yaml | 4 +- .../deployments/test-deployment-broken.yaml | 2 +- .../deployments/test-deployment-test.yaml | 2 +- test/extended/testdata/image/test-image.json | 2 +- .../imagestream-jenkins-slave-pods.yaml | 5 +- .../imagestreamtag-jenkins-slave-pods.yaml | 5 +- .../jenkins-plugin/multitag-template.json | 6 +- test/extended/testdata/jobs/v1.yaml | 2 +- .../extended/testdata/long_names/fixture.json | 4 +- test/extended/testdata/router/ingress.yaml | 6 +- .../router/reencrypt-serving-cert.yaml | 2 +- .../testdata/router/router-common.yaml | 4 +- .../router/router-config-manager.yaml | 5 +- .../router/router-http-echo-server.yaml | 2 +- .../testdata/router/router-metrics.yaml | 6 +- .../testdata/router/weighted-router.yaml | 9 +- .../testdata/run_policy/parallel-bc.yaml | 2 +- .../testdata/run_policy/serial-bc.yaml | 4 +- .../run_policy/serial-latest-only-bc.yaml | 2 +- .../templates/templateinstance_badobject.yaml | 2 +- .../templateinstance_objectkinds.yaml | 2 +- test/extended/testdata/test-cli-debug.yaml | 6 +- .../testdata/test-deployment-config.yaml | 2 +- test/extended/testdata/test-env-pod.json | 2 +- .../testdata/test-replication-controller.yaml | 2 +- test/extended/topology_manager/utils.go | 3 +- .../generated/zz_generated.annotations.go | 2 +- test/extended/util/framework.go | 62 +--- test/extended/util/image/image.go | 52 +++- test/extended/util/image/zz_generated.txt | 52 ++++ test/extended/util/pods.go | 16 +- test/extended/util/url/url.go | 10 +- test/integration/testdata/test-buildcli.json | 4 +- 126 files changed, 791 insertions(+), 658 deletions(-) create mode 100644 test/extended/util/image/zz_generated.txt diff --git a/cmd/openshift-tests/images.go b/cmd/openshift-tests/images.go index 71bc92720e69..6f18b0903fa5 100644 --- a/cmd/openshift-tests/images.go +++ b/cmd/openshift-tests/images.go @@ -169,7 +169,8 @@ func verifyImagesWithoutEnv() error { // pulledInvalidImages returns a function that checks whether the cluster pulled an image that is // outside the allowed list of images. The list is defined as a set of static test case images, the // local cluster registry, any repository referenced by the image streams in the cluster's 'openshift' -// namespace, or the location that input images are cloned from. +// namespace, or the location that input images are cloned from. Only namespaces prefixed with 'e2e-' +// are checked. func pulledInvalidImages(fromRepository string) func(events monitor.EventIntervals) ([]*ginkgo.JUnitTestCase, bool) { // static allowed images allowedImages := sets.NewString("image/webserver:404") @@ -179,13 +180,20 @@ func pulledInvalidImages(fromRepository string) func(events monitor.EventInterva "gcr.io/authenticated-image-pulling/", "invalid.com/", - // used by the CI infrastructure, eventually should be created as an image stream tag in - // openshift so that it is automatically excluded - "grafana/loki", - "grafana/promtail", - // this is used by an operator hub test and is not replaced today (in the future OLM should - // use image streams to reference these and we can exclude those that match) - "quay.io/helmoperators/cockroachdb", + // installed alongside OLM and managed externally + "registry.redhat.io/redhat/community-operator-index", + "registry.redhat.io/redhat/certified-operator-index", + "registry.redhat.io/redhat/redhat-marketplace-index", + "registry.redhat.io/redhat/redhat-operator-index", + + // used by OLM tests + "registry.redhat.io/amq7/amq-streams-rhel7-operator", + "registry.redhat.io/amq7/amqstreams-rhel7-operator-metadata", + + // used to test pull secrets against an authenticated registry + // TODO: will not work for a disconnected test environment and should be emulated by launching + // an authenticated registry in a pod on cluster + "registry.redhat.io/rhscl/nodejs-10-rhel7:latest", ) if len(fromRepository) > 0 { allowedPrefixes.Insert(fromRepository) @@ -207,9 +215,15 @@ func pulledInvalidImages(fromRepository string) func(events monitor.EventInterva pulls := make(map[string]sets.String) for _, event := range events { + // only messages that include a Pulled reason if !strings.Contains(event.Message, " reason/Pulled ") { continue } + // only look at pull events from an e2e-* namespace + if !strings.Contains(event.Locator, " ns/e2e-") { + continue + } + parts := strings.Split(event.Message, " ") if len(parts) == 0 { continue diff --git a/test/e2e/upgrade/alert/alert.go b/test/e2e/upgrade/alert/alert.go index 02f08d93d0d7..271e321a4e56 100644 --- a/test/e2e/upgrade/alert/alert.go +++ b/test/e2e/upgrade/alert/alert.go @@ -75,7 +75,7 @@ func (t *UpgradeTest) Test(f *framework.Framework, done <-chan struct{}, upgrade } t.oc.SetupProject() ns := t.oc.Namespace() - execPod := exutil.CreateUbiExecPodOrFail(t.oc.AdminKubeClient(), ns, "execpod", nil) + execPod := exutil.CreateExecPodOrFail(t.oc.AdminKubeClient(), ns, "execpod") defer func() { t.oc.AdminKubeClient().CoreV1().Pods(ns).Delete(ctx, execPod.Name, *metav1.NewDeleteOptions(1)) }() diff --git a/test/e2e/upgrade/monitor.go b/test/e2e/upgrade/monitor.go index afb095052732..3b1118cb5d32 100644 --- a/test/e2e/upgrade/monitor.go +++ b/test/e2e/upgrade/monitor.go @@ -20,6 +20,7 @@ import ( configv1 "github.com/openshift/api/config/v1" configv1client "github.com/openshift/client-go/config/clientset/versioned" "github.com/openshift/origin/test/extended/util/disruption" + "github.com/openshift/origin/test/extended/util/image" ) type versionMonitor struct { @@ -336,7 +337,7 @@ func triggerReboot(kubeClient kubernetes.Interface, target string, attempt int, RunAsUser: &zero, Privileged: &isTrue, }, - Image: "ubi8/ubi", + Image: image.ShellImage(), Command: []string{ "/bin/bash", "-c", diff --git a/test/extended/apiserver/kubeconfigs.go b/test/extended/apiserver/kubeconfigs.go index 21fe39fac7c6..af01a58e8db6 100644 --- a/test/extended/apiserver/kubeconfigs.go +++ b/test/extended/apiserver/kubeconfigs.go @@ -32,7 +32,7 @@ var _ = g.Describe("[Conformance][sig-api-machinery][Feature:APIServer] local ku g.By("Testing master node " + master.Name) kubeconfigPath := "/etc/kubernetes/static-pod-resources/kube-apiserver-certs/secrets/node-kubeconfigs/" + kubeconfig framework.Logf("Verifying kubeconfig %q on master %s", master.Name) - out, err := oc.AsAdmin().Run("debug").Args("node/"+master.Name, "--image=registry.access.redhat.com/ubi8/ubi-minimal:latest", "--", "chroot", "/host", "/bin/bash", "-euxo", "pipefail", "-c", fmt.Sprintf(`oc --kubeconfig "%s" get namespace kube-system`, kubeconfigPath)).Output() + out, err := oc.AsAdmin().Run("debug").Args("node/"+master.Name, "--", "chroot", "/host", "/bin/bash", "-euxo", "pipefail", "-c", fmt.Sprintf(`oc --kubeconfig "%s" get namespace kube-system`, kubeconfigPath)).Output() o.Expect(err).NotTo(o.HaveOccurred()) framework.Logf(out) } diff --git a/test/extended/builds/contextdir.go b/test/extended/builds/contextdir.go index d586ebb1c2ba..d27c28582d8c 100644 --- a/test/extended/builds/contextdir.go +++ b/test/extended/builds/contextdir.go @@ -10,6 +10,7 @@ import ( imageeco "github.com/openshift/origin/test/extended/image_ecosystem" exutil "github.com/openshift/origin/test/extended/util" + "github.com/openshift/origin/test/extended/util/image" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -102,7 +103,7 @@ var _ = g.Describe("[sig-builds][Feature:Builds][Slow] builds with a context dir repo, err := exutil.NewGitRepo("contextdir") o.Expect(err).NotTo(o.HaveOccurred()) defer repo.Remove() - err = repo.AddAndCommit("2.3/Dockerfile", "FROM busybox") + err = repo.AddAndCommit("2.3/Dockerfile", fmt.Sprintf("FROM %s", image.ShellImage())) o.Expect(err).NotTo(o.HaveOccurred()) exutil.WaitForOpenShiftNamespaceImageStreams(oc) diff --git a/test/extended/builds/dockerfile.go b/test/extended/builds/dockerfile.go index d5d275c62605..0dcdf2881db7 100644 --- a/test/extended/builds/dockerfile.go +++ b/test/extended/builds/dockerfile.go @@ -13,6 +13,7 @@ import ( "github.com/openshift/library-go/pkg/image/imageutil" exutil "github.com/openshift/origin/test/extended/util" + "github.com/openshift/origin/test/extended/util/image" ) var _ = g.Describe("[sig-builds][Feature:Builds][Slow] build can have Dockerfile input", func() { @@ -20,12 +21,12 @@ var _ = g.Describe("[sig-builds][Feature:Builds][Slow] build can have Dockerfile var ( oc = exutil.NewCLI("build-dockerfile-env") dockerfileAdd = exutil.FixturePath("testdata", "builds", "docker-add") - testDockerfile = ` -FROM library/busybox + testDockerfile = fmt.Sprintf(` +FROM %s USER 1001 -` +`, image.ShellImage()) testDockerfile2 = ` -FROM centos:7 +FROM image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5 USER 1001 ` testDockerfile3 = ` @@ -85,31 +86,31 @@ USER 1001 o.Expect(err).NotTo(o.HaveOccurred()) g.By("checking the buildconfig content") - bc, err := oc.BuildClient().BuildV1().BuildConfigs(oc.Namespace()).Get(context.Background(), "centos", metav1.GetOptions{}) + bc, err := oc.BuildClient().BuildV1().BuildConfigs(oc.Namespace()).Get(context.Background(), "ruby", metav1.GetOptions{}) o.Expect(err).NotTo(o.HaveOccurred()) o.Expect(bc.Spec.Source.Git).To(o.BeNil()) o.Expect(*bc.Spec.Source.Dockerfile).To(o.Equal(testDockerfile2)) o.Expect(bc.Spec.Output.To).ToNot(o.BeNil()) - o.Expect(bc.Spec.Output.To.Name).To(o.Equal("centos:latest")) + o.Expect(bc.Spec.Output.To.Name).To(o.Equal("ruby:latest")) - buildName := "centos-1" + buildName := "ruby-1" g.By("expecting the Dockerfile build is in Complete phase") err = exutil.WaitForABuild(oc.BuildClient().BuildV1().Builds(oc.Namespace()), buildName, nil, nil, nil) //debug for failures if err != nil { - exutil.DumpBuildLogs("centos", oc) + exutil.DumpBuildLogs("ruby", oc) } o.Expect(err).NotTo(o.HaveOccurred()) g.By("getting the built container image reference from ImageStream") - image, err := oc.ImageClient().ImageV1().ImageStreamTags(oc.Namespace()).Get(context.Background(), "centos:latest", metav1.GetOptions{}) + image, err := oc.ImageClient().ImageV1().ImageStreamTags(oc.Namespace()).Get(context.Background(), "ruby:latest", metav1.GetOptions{}) o.Expect(err).NotTo(o.HaveOccurred()) err = imageutil.ImageWithMetadata(&image.Image) o.Expect(err).NotTo(o.HaveOccurred()) o.Expect(image.Image.DockerImageMetadata.Object.(*docker10.DockerImage).Config.User).To(o.Equal("1001")) g.By("checking for the imported tag") - _, err = oc.ImageClient().ImageV1().ImageStreamTags(oc.Namespace()).Get(context.Background(), "centos:7", metav1.GetOptions{}) + _, err = oc.ImageClient().ImageV1().ImageStreamTags(oc.Namespace()).Get(context.Background(), "ruby:2.5", metav1.GetOptions{}) o.Expect(err).NotTo(o.HaveOccurred()) }) diff --git a/test/extended/builds/hooks.go b/test/extended/builds/hooks.go index 8d5b01fc2b13..5143a9a02e0d 100644 --- a/test/extended/builds/hooks.go +++ b/test/extended/builds/hooks.go @@ -2,6 +2,7 @@ package builds import ( "context" + "fmt" "time" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -10,6 +11,7 @@ import ( o "github.com/onsi/gomega" exutil "github.com/openshift/origin/test/extended/util" + "github.com/openshift/origin/test/extended/util/image" ) var _ = g.Describe("[sig-builds][Feature:Builds][Slow] testing build configuration hooks", func() { @@ -163,7 +165,7 @@ var _ = g.Describe("[sig-builds][Feature:Builds][Slow] testing build configurati o.Expect(err).NotTo(o.HaveOccurred()) err = oc.Run("patch").Args("bc/mydockertest", "-p", `{"spec":{"output":{"to":{"kind":"ImageStreamTag","name":"mydockertest:latest"}}}}`).Execute() o.Expect(err).NotTo(o.HaveOccurred()) - err = oc.Run("patch").Args("bc/mydockertest", "-p", `{"spec":{"source":{"dockerfile":"FROM busybox:latest \n ENTRYPOINT /bin/sleep 600 \n"}}}`).Execute() + err = oc.Run("patch").Args("bc/mydockertest", "-p", fmt.Sprintf(`{"spec":{"source":{"dockerfile":"FROM %s \n ENTRYPOINT /bin/sleep 600 \n"}}}`, image.ShellImage())).Execute() o.Expect(err).NotTo(o.HaveOccurred()) g.By("starting a build") diff --git a/test/extended/builds/multistage.go b/test/extended/builds/multistage.go index 0e6551536861..20bc663c099d 100644 --- a/test/extended/builds/multistage.go +++ b/test/extended/builds/multistage.go @@ -14,108 +14,106 @@ import ( buildv1 "github.com/openshift/api/build/v1" eximages "github.com/openshift/origin/test/extended/images" exutil "github.com/openshift/origin/test/extended/util" + "github.com/openshift/origin/test/extended/util/image" ) var _ = g.Describe("[sig-builds][Feature:Builds] Multi-stage image builds", func() { defer g.GinkgoRecover() var ( oc = exutil.NewCLI("build-multistage") - testDockerfile = ` + testDockerfile = fmt.Sprintf(` FROM scratch as test USER 1001 -FROM registry.redhat.io/rhel7 +FROM %[1]s as other COPY --from=test /usr/bin/curl /test/ -COPY --from=busybox:latest /bin/echo /test/ -COPY --from=busybox:latest /bin/ping /test/ -` +COPY --from=%[2]s /bin/echo /test/ +COPY --from=%[2]s /bin/ping /test/ +`, image.LimitedShellImage(), image.ShellImage()) ) - g.Context("", func() { - - g.AfterEach(func() { - if g.CurrentGinkgoTestDescription().Failed { - exutil.DumpPodStates(oc) - exutil.DumpConfigMapStates(oc) - exutil.DumpPodLogsStartingWith("", oc) - } - }) + g.AfterEach(func() { + if g.CurrentGinkgoTestDescription().Failed { + exutil.DumpPodStates(oc) + exutil.DumpConfigMapStates(oc) + exutil.DumpPodLogsStartingWith("", oc) + } + }) - g.It("should succeed", func() { - g.By("creating a build directly") - registryURL, err := eximages.GetDockerRegistryURL(oc) - o.Expect(err).NotTo(o.HaveOccurred()) + g.It("should succeed", func() { + g.By("creating a build directly") + registryURL, err := eximages.GetDockerRegistryURL(oc) + o.Expect(err).NotTo(o.HaveOccurred()) - build, err := oc.BuildClient().BuildV1().Builds(oc.Namespace()).Create(context.Background(), &buildv1.Build{ - ObjectMeta: metav1.ObjectMeta{ - Name: "multi-stage", - }, - Spec: buildv1.BuildSpec{ - CommonSpec: buildv1.CommonSpec{ - Source: buildv1.BuildSource{ - Dockerfile: &testDockerfile, - Images: []buildv1.ImageSource{ - {From: corev1.ObjectReference{Kind: "DockerImage", Name: "centos:7"}, As: []string{"scratch"}}, - }, - }, - Strategy: buildv1.BuildStrategy{ - DockerStrategy: &buildv1.DockerBuildStrategy{}, + build, err := oc.BuildClient().BuildV1().Builds(oc.Namespace()).Create(context.Background(), &buildv1.Build{ + ObjectMeta: metav1.ObjectMeta{ + Name: "multi-stage", + }, + Spec: buildv1.BuildSpec{ + CommonSpec: buildv1.CommonSpec{ + Source: buildv1.BuildSource{ + Dockerfile: &testDockerfile, + Images: []buildv1.ImageSource{ + {From: corev1.ObjectReference{Kind: "DockerImage", Name: image.ShellImage()}, As: []string{"scratch"}}, }, - Output: buildv1.BuildOutput{ - To: &corev1.ObjectReference{ - Kind: "DockerImage", - Name: fmt.Sprintf("%s/%s/multi-stage:v1", registryURL, oc.Namespace()), - }, + }, + Strategy: buildv1.BuildStrategy{ + DockerStrategy: &buildv1.DockerBuildStrategy{}, + }, + Output: buildv1.BuildOutput{ + To: &corev1.ObjectReference{ + Kind: "DockerImage", + Name: fmt.Sprintf("%s/%s/multi-stage:v1", registryURL, oc.Namespace()), }, }, }, - }, metav1.CreateOptions{}) - o.Expect(err).NotTo(o.HaveOccurred()) - result := exutil.NewBuildResult(oc, build) - err = exutil.WaitForBuildResult(oc.AdminBuildClient().BuildV1().Builds(oc.Namespace()), result) - o.Expect(err).NotTo(o.HaveOccurred()) + }, + }, metav1.CreateOptions{}) + o.Expect(err).NotTo(o.HaveOccurred()) + result := exutil.NewBuildResult(oc, build) + err = exutil.WaitForBuildResult(oc.AdminBuildClient().BuildV1().Builds(oc.Namespace()), result) + o.Expect(err).NotTo(o.HaveOccurred()) - pod, err := oc.KubeClient().CoreV1().Pods(oc.Namespace()).Get(context.Background(), build.Name+"-build", metav1.GetOptions{}) - o.Expect(err).NotTo(o.HaveOccurred()) - o.Expect(result.BuildSuccess).To(o.BeTrue(), "Build did not succeed: %#v", result) + pod, err := oc.KubeClient().CoreV1().Pods(oc.Namespace()).Get(context.Background(), build.Name+"-build", metav1.GetOptions{}) + o.Expect(err).NotTo(o.HaveOccurred()) + o.Expect(result.BuildSuccess).To(o.BeTrue(), "Build did not succeed: %#v", result) - s, err := result.Logs() - o.Expect(err).NotTo(o.HaveOccurred()) - o.Expect(s).ToNot(o.ContainSubstring("--> FROM scratch")) - o.Expect(s).ToNot(o.ContainSubstring("FROM busybox")) - o.Expect(s).To(o.ContainSubstring("STEP 1: FROM centos:7 AS test")) - o.Expect(s).To(o.ContainSubstring("COPY --from")) - o.Expect(s).To(o.ContainSubstring(fmt.Sprintf("\"OPENSHIFT_BUILD_NAMESPACE\"=\"%s\"", oc.Namespace()))) - e2e.Logf("Build logs:\n%s", result) + s, err := result.Logs() + o.Expect(err).NotTo(o.HaveOccurred()) + o.Expect(s).ToNot(o.ContainSubstring("--> FROM scratch")) + o.Expect(s).ToNot(o.ContainSubstring("FROM busybox")) + o.Expect(s).To(o.ContainSubstring(fmt.Sprintf("STEP 1: FROM %s AS test", image.ShellImage()))) + o.Expect(s).To(o.ContainSubstring("COPY --from")) + o.Expect(s).To(o.ContainSubstring(fmt.Sprintf("\"OPENSHIFT_BUILD_NAMESPACE\"=\"%s\"", oc.Namespace()))) + e2e.Logf("Build logs:\n%s", result) - c := oc.KubeFramework().PodClient() - pod = c.Create(&corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - }, - Spec: corev1.PodSpec{ - RestartPolicy: corev1.RestartPolicyNever, - Containers: []corev1.Container{ - { - Name: "run", - Image: fmt.Sprintf("%s/%s/multi-stage:v1", registryURL, oc.Namespace()), - Command: []string{"/test/curl", "-k", "https://kubernetes.default.svc"}, - }, - { - Name: "check", - Image: fmt.Sprintf("%s/%s/multi-stage:v1", registryURL, oc.Namespace()), - Command: []string{"ls", "/test/"}, - }, + c := oc.KubeFramework().PodClient() + pod = c.Create(&corev1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test", + }, + Spec: corev1.PodSpec{ + RestartPolicy: corev1.RestartPolicyNever, + Containers: []corev1.Container{ + { + Name: "run", + Image: fmt.Sprintf("%s/%s/multi-stage:v1", registryURL, oc.Namespace()), + Command: []string{"/test/curl", "-k", "https://kubernetes.default.svc"}, + }, + { + Name: "check", + Image: fmt.Sprintf("%s/%s/multi-stage:v1", registryURL, oc.Namespace()), + Command: []string{"ls", "/test/"}, }, }, - }) - c.WaitForSuccess(pod.Name, e2e.PodStartTimeout) - data, err := oc.Run("logs").Args("-f", "test", "-c", "run").Output() - o.Expect(err).NotTo(o.HaveOccurred()) - m, err := oc.Run("logs").Args("-f", "test", "-c", "check").Output() - o.Expect(err).NotTo(o.HaveOccurred()) - o.Expect(m).To(o.ContainSubstring("echo")) - o.Expect(m).To(o.ContainSubstring("ping")) - e2e.Logf("Pod logs:\n%s\n%s", string(data), string(m)) + }, }) + c.WaitForSuccess(pod.Name, e2e.PodStartTimeout) + data, err := oc.Run("logs").Args("-f", "test", "-c", "run").Output() + o.Expect(err).NotTo(o.HaveOccurred()) + m, err := oc.Run("logs").Args("-f", "test", "-c", "check").Output() + o.Expect(err).NotTo(o.HaveOccurred()) + o.Expect(m).To(o.ContainSubstring("echo")) + o.Expect(m).To(o.ContainSubstring("ping")) + e2e.Logf("Pod logs:\n%s\n%s", string(data), string(m)) }) }) diff --git a/test/extended/builds/optimized.go b/test/extended/builds/optimized.go index 99df2b3d0335..80b65f8a516d 100644 --- a/test/extended/builds/optimized.go +++ b/test/extended/builds/optimized.go @@ -13,6 +13,7 @@ import ( buildv1 "github.com/openshift/api/build/v1" exutil "github.com/openshift/origin/test/extended/util" + "github.com/openshift/origin/test/extended/util/image" ) var _ = g.Describe("[sig-builds][Feature:Builds] Optimized image builds", func() { @@ -20,11 +21,11 @@ var _ = g.Describe("[sig-builds][Feature:Builds] Optimized image builds", func() var ( oc = exutil.NewCLI("build-dockerfile-env") skipLayers = buildv1.ImageOptimizationSkipLayers - testDockerfile = ` -FROM centos:7 + testDockerfile = fmt.Sprintf(` +FROM %s RUN yum list installed USER 1001 -` +`, image.ShellImage()) ) g.Context("", func() { diff --git a/test/extended/builds/service.go b/test/extended/builds/service.go index 243430749fe9..5d8054f297e6 100644 --- a/test/extended/builds/service.go +++ b/test/extended/builds/service.go @@ -2,6 +2,7 @@ package builds import ( "context" + "fmt" g "github.com/onsi/ginkgo" o "github.com/onsi/gomega" @@ -9,19 +10,21 @@ import ( kapierrs "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" kdeployutil "k8s.io/kubernetes/test/e2e/framework/deployment" + k8simage "k8s.io/kubernetes/test/utils/image" exutil "github.com/openshift/origin/test/extended/util" + "github.com/openshift/origin/test/extended/util/image" ) var _ = g.Describe("[sig-builds][Feature:Builds] build can reference a cluster service", func() { defer g.GinkgoRecover() var ( oc = exutil.NewCLI("build-service") - testDockerfile = ` -FROM centos:7 + testDockerfile = fmt.Sprintf(` +FROM %s RUN cat /etc/resolv.conf -RUN curl -vvv hello-openshift:8080 -` +RUN curl -vvv hello-openshift:6379 +`, image.ShellImage()) ) g.Context("", func() { @@ -41,7 +44,7 @@ RUN curl -vvv hello-openshift:8080 g.Describe("with a build being created from new-build", func() { g.It("should be able to run a build that references a cluster service", func() { g.By("standing up a new hello world service") - err := oc.Run("new-app").Args("docker.io/openshift/hello-openshift").Execute() + err := oc.Run("new-app").Args("--name", "hello-openshift", k8simage.GetE2EImage(k8simage.Redis)).Execute() o.Expect(err).NotTo(o.HaveOccurred()) deploy, derr := oc.KubeClient().AppsV1().Deployments(oc.Namespace()).Get(context.Background(), "hello-openshift", metav1.GetOptions{}) @@ -60,14 +63,14 @@ RUN curl -vvv hello-openshift:8080 o.Expect(err).NotTo(o.HaveOccurred()) g.By("calling oc new-build with a Dockerfile") - err = oc.Run("new-build").Args("-D", "-").InputString(testDockerfile).Execute() + err = oc.Run("new-build").Args("-D", "-", "--to", "test:latest").InputString(testDockerfile).Execute() o.Expect(err).NotTo(o.HaveOccurred()) g.By("expecting the build is in Complete phase") - err = exutil.WaitForABuild(oc.BuildClient().BuildV1().Builds(oc.Namespace()), "centos-1", nil, nil, nil) + err = exutil.WaitForABuild(oc.BuildClient().BuildV1().Builds(oc.Namespace()), "test-1", nil, nil, nil) //debug for failures if err != nil { - exutil.DumpBuildLogs("centos", oc) + exutil.DumpBuildLogs("test", oc) } o.Expect(err).NotTo(o.HaveOccurred()) }) diff --git a/test/extended/cli/compat.go b/test/extended/cli/compat.go index 3b9bf019c36b..5852ea8e32d9 100644 --- a/test/extended/cli/compat.go +++ b/test/extended/cli/compat.go @@ -13,11 +13,10 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" exutil "github.com/openshift/origin/test/extended/util" + "github.com/openshift/origin/test/extended/util/image" ) func cliPod(cli *exutil.CLI, shell string) *kapiv1.Pod { - cliImage, _ := exutil.FindCLIImage(cli) - return &kapiv1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "cli-test", @@ -27,7 +26,7 @@ func cliPod(cli *exutil.CLI, shell string) *kapiv1.Pod { Containers: []kapiv1.Container{ { Name: "test", - Image: cliImage, + Image: image.ShellImage(), Command: []string{"/bin/bash", "-c", "set -euo pipefail; " + shell}, Env: []kapiv1.EnvVar{ { @@ -41,9 +40,7 @@ func cliPod(cli *exutil.CLI, shell string) *kapiv1.Pod { } } -func cliPodWithImage(cli *exutil.CLI, image string, shell string) *kapiv1.Pod { - cliImage, _ := exutil.FindCLIImage(cli) - +func cliPodWithImage(cli *exutil.CLI, shell string) *kapiv1.Pod { return &kapiv1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "cli-test", @@ -51,50 +48,17 @@ func cliPodWithImage(cli *exutil.CLI, image string, shell string) *kapiv1.Pod { Spec: kapiv1.PodSpec{ ServiceAccountName: "builder", RestartPolicy: kapiv1.RestartPolicyNever, - Volumes: []kapiv1.Volume{ - { - Name: "bin", - VolumeSource: kapiv1.VolumeSource{ - EmptyDir: &kapiv1.EmptyDirVolumeSource{}, - }, - }, - }, - InitContainers: []kapiv1.Container{ - { - Name: "cli", - Image: cliImage, - Command: []string{"/bin/bash", "-c", "set -e; cp /usr/bin/oc /tmp/bin/"}, - Env: []kapiv1.EnvVar{ - { - Name: "HOME", - Value: "/tmp", - }, - }, - VolumeMounts: []kapiv1.VolumeMount{ - { - Name: "bin", - MountPath: "/tmp/bin", - }, - }, - }, - }, Containers: []kapiv1.Container{ { Name: "test", - Image: cliImage, - Command: []string{"/bin/bash", "-c", "set -euo pipefail; export PATH=/tmp/bin:$PATH; " + shell}, + Image: image.ShellImage(), + Command: []string{"/bin/bash", "-c", shell}, Env: []kapiv1.EnvVar{ { Name: "HOME", Value: "/tmp", }, }, - VolumeMounts: []kapiv1.VolumeMount{ - { - Name: "bin", - MountPath: "/tmp/bin", - }, - }, }, }, }, @@ -128,7 +92,7 @@ var _ = g.Describe("[sig-cli] CLI", func() { }, metav1.CreateOptions{}) o.Expect(err).NotTo(o.HaveOccurred()) - pod := cli.Create(cliPodWithImage(oc, "busybox:latest", heredoc.Docf(` + pod := cli.Create(cliPodWithImage(oc, heredoc.Docf(` set -x # verify we can make API calls diff --git a/test/extended/cli/debug.go b/test/extended/cli/debug.go index 4e127476bfe5..368c4d62cd43 100644 --- a/test/extended/cli/debug.go +++ b/test/extended/cli/debug.go @@ -37,7 +37,7 @@ var _ = g.Describe("[sig-cli] oc debug", func() { var out string out, err = oc.Run("debug").Args("dc/local-busybox1").Output() o.Expect(err).NotTo(o.HaveOccurred()) - o.Expect(out).To(o.ContainSubstring("Starting pod/local-busybox1-debug, command was: sh\n")) + o.Expect(out).To(o.ContainSubstring("Starting pod/local-busybox1-debug, command was: /usr/bin/bash\n")) g.By("should print the overridden imagestream-based container entrypoint/command") out, err = oc.Run("debug").Args("dc/local-busybox2").Output() diff --git a/test/extended/csrapprover/csrapprover.go b/test/extended/csrapprover/csrapprover.go index e0b2c2937fe8..b11de4882b94 100644 --- a/test/extended/csrapprover/csrapprover.go +++ b/test/extended/csrapprover/csrapprover.go @@ -29,6 +29,7 @@ import ( exutil "github.com/openshift/origin/test/extended/util" "github.com/openshift/origin/test/extended/util/ibmcloud" + "github.com/openshift/origin/test/extended/util/image" ) var _ = g.Describe("[sig-cluster-lifecycle]", func() { @@ -45,7 +46,7 @@ var _ = g.Describe("[sig-cluster-lifecycle]", func() { // the /config/master API port+endpoint is only visible from inside the cluster // (-> we need to create a pod to try to reach it) and contains the token // of the node-bootstrapper SA, so no random pods should be able to see it - pod, err := exutil.NewPodExecutor(oc, "get-bootstrap-creds", "docker.io/fedora:32") + pod, err := exutil.NewPodExecutor(oc, "get-bootstrap-creds", image.ShellImage()) o.Expect(err).NotTo(o.HaveOccurred()) // get the API server URL, mutate to internal API (use infra.Status.APIServerURLInternal) once API is bumped diff --git a/test/extended/deployments/deployments.go b/test/extended/deployments/deployments.go index 4a77596ccb55..0bdcb5e7f3bc 100644 --- a/test/extended/deployments/deployments.go +++ b/test/extended/deployments/deployments.go @@ -31,6 +31,7 @@ import ( "github.com/openshift/library-go/pkg/image/imageutil" exutil "github.com/openshift/origin/test/extended/util" + "github.com/openshift/origin/test/extended/util/image" ) const deploymentRunTimeout = 5 * time.Minute @@ -424,8 +425,8 @@ var _ = g.Describe("[sig-apps][Feature:DeploymentConfig] deploymentconfigs", fun o.Expect(dc.Name).To(o.Equal(dcName)) o.Expect(waitForSyncedConfig(oc, dcName, deploymentRunTimeout)).NotTo(o.HaveOccurred()) - g.By("tagging the ubi-minimal:latest as test:v1 image") - _, err = oc.Run("tag").Args("registry.access.redhat.com/ubi8/ubi-minimal:latest", "test:v1").Output() + g.By("tagging the initial test:v1 image") + _, err = oc.Run("tag").Args("image-registry.openshift-image-registry.svc:5000/openshift/cli:latest", "test:v1").Output() o.Expect(err).NotTo(o.HaveOccurred()) expectLatestVersion := func(version int) { @@ -455,8 +456,8 @@ var _ = g.Describe("[sig-apps][Feature:DeploymentConfig] deploymentconfigs", fun o.Expect(err).NotTo(o.HaveOccurred()) o.Expect(waitForSyncedConfig(oc, dcName, deploymentRunTimeout)).NotTo(o.HaveOccurred()) - g.By("tagging the ubi-minimal:8.0-127 as test:v2 image") - _, err = oc.Run("tag").Args("registry.access.redhat.com/ubi8/ubi-minimal:8.0-127", "test:v2").Output() + g.By("tagging a different image as test:v2") + _, err = oc.Run("tag").Args("image-registry.openshift-image-registry.svc:5000/openshift/tools:latest", "test:v2").Output() o.Expect(err).NotTo(o.HaveOccurred()) g.By("ensuring the deployment config latest version is 2 and rollout completed") @@ -502,8 +503,8 @@ var _ = g.Describe("[sig-apps][Feature:DeploymentConfig] deploymentconfigs", fun } o.Expect(pollErr).NotTo(o.HaveOccurred()) - if istag.Tag == nil || istag.Tag.From == nil || istag.Tag.From.Name != "openshift/origin-pod" { - err = fmt.Errorf("expected %q to be part of the image reference in %#v", "openshift/origin-pod", istag) + if istag.Tag == nil || istag.Tag.From == nil || istag.Tag.From.Name != image.ShellImage() { + err = fmt.Errorf("expected %q to be part of the image reference in %#v", image.ShellImage(), istag) o.Expect(err).NotTo(o.HaveOccurred()) } }) @@ -1520,8 +1521,8 @@ var _ = g.Describe("[sig-apps][Feature:DeploymentConfig] deploymentconfigs", fun dc, err = oc.AppsClient().AppsV1().DeploymentConfigs(namespace).Create(context.Background(), dc, metav1.CreateOptions{}) o.Expect(err).NotTo(o.HaveOccurred()) - g.By("tagging the ubi-minimal:latest as test:v1 image to create ImageStream") - out, err := oc.Run("tag").Args("registry.access.redhat.com/ubi8/ubi-minimal:latest", "test:v1").Output() + g.By("tagging the tools image as test:v1 to create ImageStream") + out, err := oc.Run("tag").Args("image-registry.openshift-image-registry.svc:5000/openshift/tools:latest", "test:v1").Output() e2e.Logf("%s", out) o.Expect(err).NotTo(o.HaveOccurred()) diff --git a/test/extended/etcd/etcd_storage_path.go b/test/extended/etcd/etcd_storage_path.go index d9c3004d9643..dcc5a3459a16 100644 --- a/test/extended/etcd/etcd_storage_path.go +++ b/test/extended/etcd/etcd_storage_path.go @@ -73,7 +73,7 @@ var OpenshiftEtcdStorageData = map[schema.GroupVersionResource]etcddata.StorageD // github.com/openshift/api/apps/v1 gvr("apps.openshift.io", "v1", "deploymentconfigs"): { - Stub: `{"metadata": {"name": "dc1g"}, "spec": {"selector": {"d": "c"}, "template": {"metadata": {"labels": {"d": "c"}}, "spec": {"containers": [{"image": "fedora:latest", "name": "container2"}]}}}}`, + Stub: `{"metadata": {"name": "dc1g"}, "spec": {"selector": {"d": "c"}, "template": {"metadata": {"labels": {"d": "c"}}, "spec": {"containers": [{"image": "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest", "name": "container2"}]}}}}`, ExpectedEtcdPath: "openshift.io/deploymentconfigs/etcdstoragepathtestnamespace/dc1g", }, // -- @@ -84,7 +84,7 @@ var OpenshiftEtcdStorageData = map[schema.GroupVersionResource]etcddata.StorageD ExpectedEtcdPath: "openshift.io/imagestreams/etcdstoragepathtestnamespace/is1g", }, gvr("image.openshift.io", "v1", "images"): { - Stub: `{"dockerImageReference": "fedora:latest", "metadata": {"name": "image1g"}}`, + Stub: `{"dockerImageReference": "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest", "metadata": {"name": "image1g"}}`, ExpectedEtcdPath: "openshift.io/images/image1g", }, // -- diff --git a/test/extended/images/append.go b/test/extended/images/append.go index 57276e314b85..ff0a7ace18fd 100644 --- a/test/extended/images/append.go +++ b/test/extended/images/append.go @@ -15,6 +15,7 @@ import ( "github.com/openshift/library-go/pkg/image/imageutil" exutil "github.com/openshift/origin/test/extended/util" + "github.com/openshift/origin/test/extended/util/image" ) func cliPodWithPullSecret(cli *exutil.CLI, shell string) *kapiv1.Pod { @@ -23,8 +24,6 @@ func cliPodWithPullSecret(cli *exutil.CLI, shell string) *kapiv1.Pod { o.Expect(sa.ImagePullSecrets).NotTo(o.BeEmpty()) pullSecretName := sa.ImagePullSecrets[0].Name - cliImage, _ := exutil.FindCLIImage(cli) - return &kapiv1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "append-test", @@ -36,7 +35,7 @@ func cliPodWithPullSecret(cli *exutil.CLI, shell string) *kapiv1.Pod { Containers: []kapiv1.Container{ { Name: "test", - Image: cliImage, + Image: image.ShellImage(), Command: []string{"/bin/bash", "-c", "set -euo pipefail; " + shell}, Env: []kapiv1.EnvVar{ { @@ -98,8 +97,8 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageAppend] Image append", func # create a second scratch image with fixed date oc image append --insecure --to %[2]s/%[1]s/test:scratch2 --image='{"Cmd":["/bin/sleep"]}' --created-at=0 - # modify a busybox image - oc image append --insecure --from docker.io/library/busybox:latest --to %[2]s/%[1]s/test:busybox1 --image '{"Cmd":["/bin/sleep"]}' + # modify a shell image + oc image append --insecure --from %[3]s --to %[2]s/%[1]s/test:busybox1 --image '{"Cmd":["/bin/sleep"]}' # verify mounting works oc create is test2 @@ -111,7 +110,7 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageAppend] Image append", func touch /tmp/test/dir/2 tar cvzf /tmp/layer.tar.gz -C /tmp/test/ . oc image append --insecure --from=%[2]s/%[1]s/test:busybox1 --to %[2]s/%[1]s/test:busybox2 /tmp/layer.tar.gz - `, ns, registry))) + `, ns, registry, image.ShellImage()))) cli.WaitForSuccess(pod.Name, podStartupTimeout) istag, err := oc.ImageClient().ImageV1().ImageStreamTags(ns).Get(context.Background(), "test:scratch1", metav1.GetOptions{}) @@ -135,7 +134,7 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageAppend] Image append", func o.Expect(err).NotTo(o.HaveOccurred()) o.Expect(istag.Image).NotTo(o.BeNil()) imageutil.ImageWithMetadataOrDie(&istag.Image) - o.Expect(istag.Image.DockerImageLayers).To(o.HaveLen(1)) + o.Expect(istag.Image.DockerImageLayers).To(o.HaveLen(7)) o.Expect(istag.Image.DockerImageLayers[0].Name).NotTo(o.Equal(GzippedEmptyLayerDigest)) err = imageutil.ImageWithMetadata(&istag.Image) o.Expect(err).NotTo(o.HaveOccurred()) @@ -146,7 +145,7 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageAppend] Image append", func o.Expect(err).NotTo(o.HaveOccurred()) o.Expect(istag.Image).NotTo(o.BeNil()) imageutil.ImageWithMetadataOrDie(&istag.Image) - o.Expect(istag.Image.DockerImageLayers).To(o.HaveLen(2)) + o.Expect(istag.Image.DockerImageLayers).To(o.HaveLen(8)) o.Expect(istag.Image.DockerImageLayers[0].Name).To(o.Equal(busyboxLayer)) err = imageutil.ImageWithMetadata(&istag.Image) o.Expect(err).NotTo(o.HaveOccurred()) diff --git a/test/extended/images/extract.go b/test/extended/images/extract.go index 40e48566c5dc..5aa9f70c0a95 100644 --- a/test/extended/images/extract.go +++ b/test/extended/images/extract.go @@ -11,6 +11,7 @@ import ( kapi "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + k8simage "k8s.io/kubernetes/test/utils/image" imageapi "github.com/openshift/api/image/v1" imageclientset "github.com/openshift/client-go/image/clientset/versioned" @@ -41,6 +42,16 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageExtract] Image extract", fu cli := oc.KubeFramework().PodClient() client := imageclientset.NewForConfigOrDie(oc.UserConfig()).ImageV1() + // import tools:latest into this namespace - working around a pull through bug with referenced docker images + // https://bugzilla.redhat.com/show_bug.cgi?id=1843253 + _, err = client.ImageStreamTags(ns).Create(context.Background(), &imageapi.ImageStreamTag{ + ObjectMeta: metav1.ObjectMeta{Name: "1:tools"}, + Tag: &imageapi.TagReference{ + From: &kapi.ObjectReference{Kind: "ImageStreamTag", Namespace: "openshift", Name: "tools:latest"}, + }, + }, metav1.CreateOptions{}) + o.Expect(err).ToNot(o.HaveOccurred()) + isi, err := client.ImageStreamImports(ns).Create(context.Background(), &imageapi.ImageStreamImport{ ObjectMeta: metav1.ObjectMeta{ Name: "1", @@ -49,11 +60,7 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageExtract] Image extract", fu Import: true, Images: []imageapi.ImageImportSpec{ { - From: kapi.ObjectReference{Kind: "DockerImage", Name: "busybox:latest"}, - To: &kapi.LocalObjectReference{Name: "busybox"}, - }, - { - From: kapi.ObjectReference{Kind: "DockerImage", Name: "mysql:latest"}, + From: kapi.ObjectReference{Kind: "DockerImage", Name: k8simage.GetE2EImage(k8simage.Agnhost)}, To: &kapi.LocalObjectReference{Name: "mysql"}, }, }, @@ -65,8 +72,8 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageExtract] Image extract", fu o.Expect(img.Status.Status).To(o.Equal("Success"), fmt.Sprintf("imagestreamimport status for spec.image[%d] (message: %s)", i, img.Status.Message)) } - // busyboxLayers := isi.Status.Images[0].Image.DockerImageLayers - // busyboxLen := len(busyboxLayers) + // toolsLayers := isi.Status.Images[0].Image.DockerImageLayers + // toolsLen := len(toolsLayers) // mysqlLayers := isi.Status.Images[1].Image.DockerImageLayers // mysqlLen := len(mysqlLayers) @@ -74,25 +81,24 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageExtract] Image extract", fu set -x # command exits if directory doesn't exist - ! oc image extract --insecure %[2]s/%[1]s/1:busybox --path=/:/tmp/doesnotexist + ! oc image extract --insecure %[2]s/%[1]s/1:tools --path=/:/tmp/doesnotexist # command exits if directory isn't empty - ! oc image extract --insecure %[2]s/%[1]s/1:busybox --path=/:/ + ! oc image extract --insecure %[2]s/%[1]s/1:tools --path=/:/ - # extract busybox to a directory, verify the contents + # extract a directory to a directory, verify the contents mkdir -p /tmp/test - oc image extract --insecure %[2]s/%[1]s/1:busybox --path=/:/tmp/test - [ -d /tmp/test/etc ] && [ -d /tmp/test/bin ] - [ -f /tmp/test/etc/passwd ] && grep root /tmp/test/etc/passwd + oc image extract --insecure %[2]s/%[1]s/1:tools --path=/etc/cron.d/:/tmp/test/ + [ -f /tmp/test/0hourly ] && grep root /tmp/test/0hourly # extract multiple individual files mkdir -p /tmp/test2 - oc image extract --insecure %[2]s/%[1]s/1:busybox --path=/etc/shadow:/tmp/test2 --path=/etc/localtime:/tmp/test2 - [ -f /tmp/test2/shadow ] && [ -f /tmp/test2/localtime ] + oc image extract --insecure %[2]s/%[1]s/1:tools --path=/etc/shadow:/tmp/test2 --path=/etc/system-release:/tmp/test2 + [ -f /tmp/test2/shadow ] && [ -L /tmp/test2/system-release ] # extract a single file to the current directory mkdir -p /tmp/test3 cd /tmp/test3 - oc image extract --insecure %[2]s/%[1]s/1:busybox --file=/etc/shadow + oc image extract --insecure %[2]s/%[1]s/1:tools --file=/etc/shadow [ -f /tmp/test3/shadow ] `, ns, registry))) cli.WaitForSuccess(pod.Name, podStartupTimeout) diff --git a/test/extended/images/imagestreamimport.go b/test/extended/images/imagestreamimport.go index 3828f40d7a2e..2eb4579a1082 100644 --- a/test/extended/images/imagestreamimport.go +++ b/test/extended/images/imagestreamimport.go @@ -28,6 +28,7 @@ import ( imagev1 "github.com/openshift/api/image/v1" exutil "github.com/openshift/origin/test/extended/util" + "github.com/openshift/origin/test/extended/util/image" ) var _ = g.Describe("[sig-imageregistry][Feature:ImageStreamImport][Serial][Slow] ImageStream API", func() { @@ -218,7 +219,7 @@ func deployEphemeralImageRegistry(oc *exutil.CLI) error { containers := []corev1.Container{ { Name: "registry", - Image: "docker.io/registry", + Image: image.LocationFor("docker.io/library/registry:2.7.1"), Ports: []corev1.ContainerPort{ { ContainerPort: 5000, diff --git a/test/extended/images/layers.go b/test/extended/images/layers.go index 35637592f8c6..c604689ef185 100644 --- a/test/extended/images/layers.go +++ b/test/extended/images/layers.go @@ -13,12 +13,14 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" e2e "k8s.io/kubernetes/test/e2e/framework" + k8simage "k8s.io/kubernetes/test/utils/image" buildv1 "github.com/openshift/api/build/v1" imagev1 "github.com/openshift/api/image/v1" buildv1client "github.com/openshift/client-go/build/clientset/versioned" imagev1client "github.com/openshift/client-go/image/clientset/versioned" exutil "github.com/openshift/origin/test/extended/util" + "github.com/openshift/origin/test/extended/util/image" ) var _ = g.Describe("[sig-imageregistry][Feature:ImageLayers] Image layer subresource", func() { @@ -85,11 +87,11 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageLayers] Image layer subreso Import: true, Images: []imagev1.ImageImportSpec{ { - From: corev1.ObjectReference{Kind: "DockerImage", Name: "busybox:latest"}, + From: corev1.ObjectReference{Kind: "DockerImage", Name: image.ShellImage()}, To: &corev1.LocalObjectReference{Name: "busybox"}, }, { - From: corev1.ObjectReference{Kind: "DockerImage", Name: "mysql:latest"}, + From: corev1.ObjectReference{Kind: "DockerImage", Name: k8simage.GetE2EImage(k8simage.Agnhost)}, To: &corev1.LocalObjectReference{Name: "mysql"}, }, }, diff --git a/test/extended/images/mirror.go b/test/extended/images/mirror.go index a22261cdd915..1d2fc50d85d8 100644 --- a/test/extended/images/mirror.go +++ b/test/extended/images/mirror.go @@ -21,10 +21,13 @@ import ( frameworkpod "k8s.io/kubernetes/test/e2e/framework/pod" exutil "github.com/openshift/origin/test/extended/util" + "github.com/openshift/origin/test/extended/util/image" ) const podStartupTimeout = 3 * time.Minute -const testPod1 = `kind: Pod + +var testPod1 = fmt.Sprintf( + `kind: Pod id: oc-image-mirror-test-1 apiVersion: v1 metadata: @@ -34,7 +37,7 @@ metadata: spec: containers: - name: registry-1 - image: docker.io/library/registry + image: %[1]s env: - name: REGISTRY_HTTP_ADDR value: :5001 @@ -45,13 +48,17 @@ spec: - name: REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY value: /tmp - name: shell - image: openshift/origin:latest + image: %[2]s command: - /bin/sleep - infinity -` +`, + image.LocationFor("docker.io/library/registry:2.7.1"), + image.ShellImage(), +) -const testPod2 = `kind: Pod +var testPod2 = fmt.Sprintf( + `kind: Pod id: oc-image-mirror-test-2 apiVersion: v1 metadata: @@ -61,7 +68,7 @@ metadata: spec: containers: - name: registry-1 - image: docker.io/library/registry + image: %[1]s env: - name: REGISTRY_HTTP_ADDR value: :5002 @@ -72,7 +79,7 @@ spec: - name: REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY value: /tmp - name: registry-2 - image: docker.io/library/registry + image: %[1]s env: - name: REGISTRY_HTTP_ADDR value: :5003 @@ -83,11 +90,14 @@ spec: - name: REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY value: /tmp - name: shell - image: openshift/origin:latest + image: %[2]s command: - /bin/sleep - infinity -` +`, + image.LocationFor("docker.io/library/registry:2.7.1"), + image.ShellImage(), +) func getRandName() string { c := 20 @@ -158,11 +168,11 @@ func (pod *testPod) syncRunning(c kclientset.Interface, ns string, timeout time. return err } -func (pod *testPod) NotErr(err error) { +func (pod *testPod) NotErr(err error) error { if err != nil { exutil.DumpPodLogsStartingWithInNamespace(pod.name, pod.oc.Namespace(), pod.oc) } - o.Expect(err).NotTo(o.HaveOccurred()) + return err } func (pod *testPod) Run() *testPod { @@ -171,7 +181,7 @@ func (pod *testPod) Run() *testPod { err := pod.oc.Run("create").Args("-f", "-").InputString(pod.spec).Execute() o.Expect(err).NotTo(o.HaveOccurred()) - pod.NotErr(pod.syncRunning(pod.oc.AdminKubeClient(), pod.oc.Namespace(), podStartupTimeout)) + o.Expect(pod.NotErr(pod.syncRunning(pod.oc.AdminKubeClient(), pod.oc.Namespace(), podStartupTimeout))).NotTo(o.HaveOccurred()) return pod } @@ -188,7 +198,7 @@ func (pod *testPod) ShellExec(command ...string) *exutil.CLI { func genDockerConfig(pod *testPod, registryURL, user, token string) { config := fmt.Sprintf(`{"auths":{%q:{"auth":%q}}}`, registryURL, base64.StdEncoding.EncodeToString([]byte(user+":"+token))) - + framework.Logf("Config file: %s", config) err := pod.ShellExec("bash", "-c", "cd /tmp; cat > config.json").InputString(config).Execute() o.Expect(err).NotTo(o.HaveOccurred()) } @@ -227,21 +237,22 @@ func requestHasStatusCode(pod *testPod, URL, token, statusCode string) { if len(m) == 0 { err = fmt.Errorf("unexpected status code (expected %s): %s", statusCode, out) } - pod.NotErr(err) + o.Expect(pod.NotErr(err)).NotTo(o.HaveOccurred()) } func testNewBuild(oc *exutil.CLI) (string, string) { isName := "mirror-" + getRandName() istName := isName + ":latest" - testDockerfile := fmt.Sprintf(`FROM busybox:latest -RUN echo %s > /1 -RUN echo %s > /2 -RUN echo %s > /3 + testDockerfile := fmt.Sprintf(`FROM %[4]s +RUN echo %[1]s > /1 +RUN echo %[2]s > /2 +RUN echo %[3]s > /3 `, getRandName(), getRandName(), getRandName(), + image.ShellImage(), ) err := oc.Run("new-build").Args("-D", "-", "--to", istName).InputString(testDockerfile).Execute() @@ -281,7 +292,7 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageMirror][Slow] Image mirror" g.By("get the protocol of integrated registry server") schema, err := getRegistrySchema(pod, registryHost) - pod.NotErr(err) + o.Expect(pod.NotErr(err)).NotTo(o.HaveOccurred()) framework.Logf("the protocol is %s://%s", schema, registryHost) @@ -300,11 +311,11 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageMirror][Slow] Image mirror" requestHasStatusCode(pod, fmt.Sprintf("http://127.0.0.1:5001/v2/%s/manifests/%s", repoName, imgName), "", "404") g.By("Mirror image from the integrated registry server to the external registry server") - command := fmt.Sprintf("cd /tmp; oc --loglevel=8 image mirror %s/%s:latest %s/%s:stable --insecure=true", + command := fmt.Sprintf("cd /tmp; oc image mirror %s/%s:latest %s/%s:stable --insecure=true --registry-config config.json", registryHost, repoName, "127.0.0.1:5001", repoName, ) err = pod.ShellExec([]string{"bash", "-c", command}...).Execute() - pod.NotErr(err) + o.Expect(pod.NotErr(err)).NotTo(o.HaveOccurred()) g.By("Check that we have it in the external registry server") requestHasStatusCode(pod, fmt.Sprintf("http://127.0.0.1:5001/v2/%s/manifests/%s", repoName, imgName), "", "200") @@ -327,7 +338,7 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageMirror][Slow] Image mirror" g.By("get the protocol of integrated registry server") schema, err := getRegistrySchema(pod, registryHost) - pod.NotErr(err) + o.Expect(pod.NotErr(err)).NotTo(o.HaveOccurred()) framework.Logf("the protocol is %s://%s", schema, registryHost) @@ -349,13 +360,13 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageMirror][Slow] Image mirror" requestHasStatusCode(pod, fmt.Sprintf("http://127.0.0.1:5003/v2/%s/manifests/%s", repoName, imgName), "", "404") g.By("Mirror image from the integrated registry server to the external registry server") - command := fmt.Sprintf("cd /tmp; oc image mirror %s/%s:latest %s/%s:stable %s/%s:prod --insecure=true", + command := fmt.Sprintf("cd /tmp; oc image mirror %s/%s:latest %s/%s:stable %s/%s:prod --insecure=true --registry-config config.json", registryHost, repoName, "127.0.0.1:5002", repoName, "127.0.0.1:5003", repoName, ) err = pod.ShellExec([]string{"bash", "-c", command}...).Execute() - pod.NotErr(err) + o.Expect(pod.NotErr(err)).NotTo(o.HaveOccurred()) g.By("Check that we have it in the first external registry server") requestHasStatusCode(pod, fmt.Sprintf("http://127.0.0.1:5002/v2/%s/manifests/%s", repoName, imgName), "", "200") diff --git a/test/extended/images/oc_tag.go b/test/extended/images/oc_tag.go index 416ad92a5b19..a713b5e305b0 100644 --- a/test/extended/images/oc_tag.go +++ b/test/extended/images/oc_tag.go @@ -10,10 +10,12 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" e2e "k8s.io/kubernetes/test/e2e/framework" + k8simage "k8s.io/kubernetes/test/utils/image" authorizationv1 "github.com/openshift/api/authorization/v1" exutil "github.com/openshift/origin/test/extended/util" + "github.com/openshift/origin/test/extended/util/image" ) var _ = g.Describe("[sig-imageregistry][Feature:Image] oc tag", func() { @@ -22,13 +24,17 @@ var _ = g.Describe("[sig-imageregistry][Feature:Image] oc tag", func() { ctx := context.Background() g.It("should preserve image reference for external images", func() { - const ( - externalRepository = "busybox" - externalImage = "busybox:latest" - isName = "busybox" - isName2 = "busybox2" + var ( + externalImage = k8simage.GetE2EImage(k8simage.BusyBox) + isName = "busybox" + isName2 = "busybox2" ) + externalRepository := externalImage + if i := strings.LastIndex(externalRepository, ":"); i != -1 { + externalRepository = externalRepository[:i] + } + g.By("import an external image") err := oc.Run("tag").Args("--source=docker", externalImage, isName+":latest").Execute() @@ -65,12 +71,12 @@ var _ = g.Describe("[sig-imageregistry][Feature:Image] oc tag", func() { }) g.It("should change image reference for internal images", func() { - const ( + var ( isName = "localimage" isName2 = "localimage2" - dockerfile = `FROM busybox:latest + dockerfile = fmt.Sprintf(`FROM %s RUN touch /test-image -` +`, image.ShellImage()) ) g.By("determine the name of the integrated registry") @@ -119,7 +125,7 @@ RUN touch /test-image }) g.It("should work when only imagestreams api is available", func() { - err := oc.Run("tag").Args("--source=docker", "busybox:latest", "testis:latest").Execute() + err := oc.Run("tag").Args("--source=docker", image.ShellImage(), "testis:latest").Execute() o.Expect(err).NotTo(o.HaveOccurred()) err = exutil.WaitForAnImageStreamTag(oc, oc.Namespace(), "testis", "latest") diff --git a/test/extended/images/resolve.go b/test/extended/images/resolve.go index b2c46f49846c..ff9ef1b4d9e0 100644 --- a/test/extended/images/resolve.go +++ b/test/extended/images/resolve.go @@ -2,6 +2,8 @@ package images import ( "context" + "fmt" + "time" g "github.com/onsi/ginkgo" o "github.com/onsi/gomega" @@ -12,6 +14,8 @@ import ( kapiv1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/wait" + k8simage "k8s.io/kubernetes/test/utils/image" exutil "github.com/openshift/origin/test/extended/util" ) @@ -23,13 +27,27 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageLookup] Image policy", func ctx := context.Background() g.It("should update standard Kube object image fields when local names are on", func() { - err := oc.Run("import-image").Args("busybox:latest", "--confirm").Execute() + err := oc.Run("tag").Args(k8simage.GetE2EImage(k8simage.BusyBox), "busybox:latest").Execute() o.Expect(err).NotTo(o.HaveOccurred()) err = oc.Run("set", "image-lookup").Args("busybox").Execute() o.Expect(err).NotTo(o.HaveOccurred()) - tag, err := oc.ImageClient().ImageV1().ImageStreamTags(oc.Namespace()).Get(ctx, "busybox:latest", metav1.GetOptions{}) + + is, err := oc.ImageClient().ImageV1().ImageStreams(oc.Namespace()).Get(ctx, "busybox", metav1.GetOptions{}) o.Expect(err).NotTo(o.HaveOccurred()) - o.Expect(tag.LookupPolicy.Local).To(o.BeTrue()) + o.Expect(is.Spec.LookupPolicy.Local).To(o.BeTrue()) + + var internalImageReference string + var lastErr error + err = wait.PollImmediate(5*time.Second, 2*time.Minute, func() (bool, error) { + tag, err := oc.ImageClient().ImageV1().ImageTags(oc.Namespace()).Get(ctx, "busybox:latest", metav1.GetOptions{}) + if err != nil || tag.Image == nil { + lastErr = err + return false, nil + } + internalImageReference = tag.Image.DockerImageReference + return true, nil + }) + o.Expect(err).NotTo(o.HaveOccurred(), fmt.Sprintf("unable to wait for image to be imported: %v", lastErr)) // pods should auto replace local references pod, err := oc.KubeClient().CoreV1().Pods(oc.Namespace()).Create(ctx, &kapiv1.Pod{ @@ -45,11 +63,11 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageLookup] Image policy", func }, metav1.CreateOptions{}) o.Expect(err).NotTo(o.HaveOccurred()) - if pod.Spec.Containers[0].Image != tag.Image.DockerImageReference { + if pod.Spec.Containers[0].Image != internalImageReference { g.Skip("default image resolution is not configured, can't verify pod resolution") } - o.Expect(pod.Spec.Containers[0].Image).To(o.Equal(tag.Image.DockerImageReference)) + o.Expect(pod.Spec.Containers[0].Image).To(o.Equal(internalImageReference)) o.Expect(pod.Spec.Containers[1].Image).To(o.HaveSuffix("/" + oc.Namespace() + "/busybox:unknown")) defer func() { oc.KubeClient().CoreV1().Pods(oc.Namespace()).Delete(ctx, pod.Name, metav1.DeleteOptions{}) }() @@ -74,18 +92,29 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageLookup] Image policy", func }, }, metav1.CreateOptions{}) o.Expect(err).NotTo(o.HaveOccurred()) - o.Expect(rs.Spec.Template.Spec.Containers[0].Image).To(o.Equal(tag.Image.DockerImageReference)) + o.Expect(rs.Spec.Template.Spec.Containers[0].Image).To(o.Equal(internalImageReference)) defer func() { oc.KubeClient().AppsV1().ReplicaSets(oc.Namespace()).Delete(ctx, rs.Name, metav1.DeleteOptions{}) }() }) g.It("should perform lookup when the object has the resolve-names annotation", func() { - err := oc.Run("import-image").Args("busybox:latest", "--confirm").Execute() - o.Expect(err).NotTo(o.HaveOccurred()) - tag, err := oc.ImageClient().ImageV1().ImageStreamTags(oc.Namespace()).Get(ctx, "busybox:latest", metav1.GetOptions{}) + err := oc.Run("tag").Args(k8simage.GetE2EImage(k8simage.BusyBox), "busybox:latest").Execute() o.Expect(err).NotTo(o.HaveOccurred()) + var internalImageReference string + var lastErr error + err = wait.PollImmediate(5*time.Second, 2*time.Minute, func() (bool, error) { + tag, err := oc.ImageClient().ImageV1().ImageTags(oc.Namespace()).Get(ctx, "busybox:latest", metav1.GetOptions{}) + if err != nil || tag.Image == nil { + lastErr = err + return false, nil + } + internalImageReference = tag.Image.DockerImageReference + return true, nil + }) + o.Expect(err).NotTo(o.HaveOccurred(), fmt.Sprintf("unable to wait for image to be imported: %v", lastErr)) + g.By("auto replacing local references on Pods") pod, err := oc.KubeClient().CoreV1().Pods(oc.Namespace()).Create(ctx, &kapiv1.Pod{ ObjectMeta: metav1.ObjectMeta{ @@ -105,11 +134,11 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageLookup] Image policy", func }, metav1.CreateOptions{}) o.Expect(err).NotTo(o.HaveOccurred()) - if pod.Spec.Containers[0].Image != tag.Image.DockerImageReference { + if pod.Spec.Containers[0].Image != internalImageReference { g.Skip("default image resolution is not configured, can't verify pod resolution") } - o.Expect(pod.Spec.Containers[0].Image).To(o.Equal(tag.Image.DockerImageReference)) + o.Expect(pod.Spec.Containers[0].Image).To(o.Equal(internalImageReference)) o.Expect(pod.Spec.Containers[1].Image).To(o.HaveSuffix("/" + oc.Namespace() + "/busybox:unknown")) g.By("auto replacing local references on ReplicaSets") @@ -136,7 +165,7 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageLookup] Image policy", func }, }, metav1.CreateOptions{}) o.Expect(err).NotTo(o.HaveOccurred()) - o.Expect(rs.Spec.Template.Spec.Containers[0].Image).To(o.Equal(tag.Image.DockerImageReference)) + o.Expect(rs.Spec.Template.Spec.Containers[0].Image).To(o.Equal(internalImageReference)) g.By("auto replacing local references on Deployments") deployment, err := oc.KubeClient().AppsV1().Deployments(oc.Namespace()).Create(ctx, &appsv1.Deployment{ @@ -162,7 +191,7 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageLookup] Image policy", func }, }, metav1.CreateOptions{}) o.Expect(err).NotTo(o.HaveOccurred()) - o.Expect(deployment.Spec.Template.Spec.Containers[0].Image).To(o.Equal(tag.Image.DockerImageReference)) + o.Expect(deployment.Spec.Template.Spec.Containers[0].Image).To(o.Equal(internalImageReference)) g.By("auto replacing local references on Deployments (in pod template)") deployment, err = oc.KubeClient().AppsV1().Deployments(oc.Namespace()).Create(ctx, &appsv1.Deployment{ @@ -190,7 +219,7 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageLookup] Image policy", func }, }, metav1.CreateOptions{}) o.Expect(err).NotTo(o.HaveOccurred()) - o.Expect(deployment.Spec.Template.Spec.Containers[0].Image).To(o.Equal(tag.Image.DockerImageReference)) + o.Expect(deployment.Spec.Template.Spec.Containers[0].Image).To(o.Equal(internalImageReference)) g.By("auto replacing local references on DaemonSets") daemonset, err := oc.KubeClient().AppsV1().DaemonSets(oc.Namespace()).Create(ctx, &appsv1.DaemonSet{ @@ -218,7 +247,7 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageLookup] Image policy", func }, }, metav1.CreateOptions{}) o.Expect(err).NotTo(o.HaveOccurred()) - o.Expect(daemonset.Spec.Template.Spec.Containers[0].Image).To(o.Equal(tag.Image.DockerImageReference)) + o.Expect(daemonset.Spec.Template.Spec.Containers[0].Image).To(o.Equal(internalImageReference)) g.By("auto replacing local references on DaemonSets (in pod template)") daemonset, err = oc.KubeClient().AppsV1().DaemonSets(oc.Namespace()).Create(ctx, &appsv1.DaemonSet{ @@ -246,7 +275,7 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageLookup] Image policy", func }, }, metav1.CreateOptions{}) o.Expect(err).NotTo(o.HaveOccurred()) - o.Expect(daemonset.Spec.Template.Spec.Containers[0].Image).To(o.Equal(tag.Image.DockerImageReference)) + o.Expect(daemonset.Spec.Template.Spec.Containers[0].Image).To(o.Equal(internalImageReference)) g.By("auto replacing local references on StatefulSets") statefulset, err := oc.KubeClient().AppsV1().StatefulSets(oc.Namespace()).Create(ctx, &appsv1.StatefulSet{ @@ -274,7 +303,7 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageLookup] Image policy", func }, }, metav1.CreateOptions{}) o.Expect(err).NotTo(o.HaveOccurred()) - o.Expect(statefulset.Spec.Template.Spec.Containers[0].Image).To(o.Equal(tag.Image.DockerImageReference)) + o.Expect(statefulset.Spec.Template.Spec.Containers[0].Image).To(o.Equal(internalImageReference)) g.By("auto replacing local references on StatefulSets (in pod template)") statefulset, err = oc.KubeClient().AppsV1().StatefulSets(oc.Namespace()).Create(ctx, &appsv1.StatefulSet{ @@ -302,7 +331,7 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageLookup] Image policy", func }, }, metav1.CreateOptions{}) o.Expect(err).NotTo(o.HaveOccurred()) - o.Expect(statefulset.Spec.Template.Spec.Containers[0].Image).To(o.Equal(tag.Image.DockerImageReference)) + o.Expect(statefulset.Spec.Template.Spec.Containers[0].Image).To(o.Equal(internalImageReference)) g.By("auto replacing local references on Jobs") job, err := oc.KubeClient().BatchV1().Jobs(oc.Namespace()).Create(ctx, &kbatchv1.Job{ @@ -328,7 +357,7 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageLookup] Image policy", func }, }, metav1.CreateOptions{}) o.Expect(err).NotTo(o.HaveOccurred()) - o.Expect(job.Spec.Template.Spec.Containers[0].Image).To(o.Equal(tag.Image.DockerImageReference)) + o.Expect(job.Spec.Template.Spec.Containers[0].Image).To(o.Equal(internalImageReference)) g.By("auto replacing local references on Jobs (in pod template)") job, err = oc.KubeClient().BatchV1().Jobs(oc.Namespace()).Create(ctx, &kbatchv1.Job{ @@ -353,7 +382,7 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageLookup] Image policy", func }, }, metav1.CreateOptions{}) o.Expect(err).NotTo(o.HaveOccurred()) - o.Expect(job.Spec.Template.Spec.Containers[0].Image).To(o.Equal(tag.Image.DockerImageReference)) + o.Expect(job.Spec.Template.Spec.Containers[0].Image).To(o.Equal(internalImageReference)) g.By("auto replacing local references on CronJobs") cronjob, err := oc.KubeClient().BatchV1beta1().CronJobs(oc.Namespace()).Create(ctx, &kbatchv1beta1.CronJob{ @@ -381,7 +410,7 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageLookup] Image policy", func }, }, metav1.CreateOptions{}) o.Expect(err).NotTo(o.HaveOccurred()) - o.Expect(cronjob.Spec.JobTemplate.Spec.Template.Spec.Containers[0].Image).To(o.Equal(tag.Image.DockerImageReference)) + o.Expect(cronjob.Spec.JobTemplate.Spec.Template.Spec.Containers[0].Image).To(o.Equal(internalImageReference)) g.By("auto replacing local references on CronJobs (in pod template)") cronjob, err = oc.KubeClient().BatchV1beta1().CronJobs(oc.Namespace()).Create(ctx, &kbatchv1beta1.CronJob{ @@ -411,15 +440,27 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageLookup] Image policy", func }, }, metav1.CreateOptions{}) o.Expect(err).NotTo(o.HaveOccurred()) - o.Expect(cronjob.Spec.JobTemplate.Spec.Template.Spec.Containers[0].Image).To(o.Equal(tag.Image.DockerImageReference)) + o.Expect(cronjob.Spec.JobTemplate.Spec.Template.Spec.Containers[0].Image).To(o.Equal(internalImageReference)) }) g.It("should perform lookup when the Deployment gets the resolve-names annotation later", func() { - err := oc.Run("import-image").Args("busybox:latest", "--confirm").Execute() - o.Expect(err).NotTo(o.HaveOccurred()) - tag, err := oc.ImageClient().ImageV1().ImageStreamTags(oc.Namespace()).Get(ctx, "busybox:latest", metav1.GetOptions{}) + imageReference := k8simage.GetE2EImage(k8simage.BusyBox) + err := oc.Run("tag").Args(imageReference, "busybox:latest").Execute() o.Expect(err).NotTo(o.HaveOccurred()) + var internalImageReference string + var lastErr error + err = wait.PollImmediate(5*time.Second, 2*time.Minute, func() (bool, error) { + tag, err := oc.ImageClient().ImageV1().ImageTags(oc.Namespace()).Get(ctx, "busybox:latest", metav1.GetOptions{}) + if err != nil || tag.Image == nil { + lastErr = err + return false, nil + } + internalImageReference = tag.Image.DockerImageReference + return true, nil + }) + o.Expect(err).NotTo(o.HaveOccurred(), fmt.Sprintf("unable to wait for image to be imported: %v", lastErr)) + deployment, err := oc.KubeClient().AppsV1().Deployments(oc.Namespace()).Create(ctx, &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{ Name: "resolve", @@ -452,6 +493,6 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageLookup] Image policy", func deployment, err = oc.KubeClient().AppsV1().Deployments(deployment.Namespace).Patch(ctx, deployment.Name, types.StrategicMergePatchType, []byte(`{"metadata": {"annotations": {"alpha.image.policy.openshift.io/resolve-names": "*"}}}`), metav1.PatchOptions{}) o.Expect(err).NotTo(o.HaveOccurred()) o.Expect(deployment.ObjectMeta.Annotations["alpha.image.policy.openshift.io/resolve-names"]).To(o.Equal("*")) - o.Expect(deployment.Spec.Template.Spec.Containers[0].Image).To(o.Equal(tag.Image.DockerImageReference)) + o.Expect(deployment.Spec.Template.Spec.Containers[0].Image).To(o.Equal(internalImageReference)) }) }) diff --git a/test/extended/networking/multicast.go b/test/extended/networking/multicast.go index 46220a93e99c..9caed1bcda84 100644 --- a/test/extended/networking/multicast.go +++ b/test/extended/networking/multicast.go @@ -10,6 +10,7 @@ import ( networkclient "github.com/openshift/client-go/network/clientset/versioned/typed/network/v1" "github.com/openshift/library-go/pkg/network/networkutils" exutil "github.com/openshift/origin/test/extended/util" + "github.com/openshift/origin/test/extended/util/image" kapiv1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -167,7 +168,7 @@ func launchTestMulticastPod(f *e2e.Framework, nodeName string, podName string) e Containers: []kapiv1.Container{ { Name: contName, - Image: "openshift/test-multicast", + Image: image.LocationFor("docker.io/openshift/test-multicast:latest"), Command: []string{"sleep", "1000"}, }, }, diff --git a/test/extended/oauth/groupsync.go b/test/extended/oauth/groupsync.go index 5643e0681ad3..d5648a32db21 100644 --- a/test/extended/oauth/groupsync.go +++ b/test/extended/oauth/groupsync.go @@ -14,6 +14,7 @@ import ( "github.com/openshift/origin/test/extended/testdata" exutil "github.com/openshift/origin/test/extended/util" + "github.com/openshift/origin/test/extended/util/image" "k8s.io/apimachinery/pkg/util/wait" e2e "k8s.io/kubernetes/test/e2e/framework" ) @@ -35,16 +36,16 @@ var _ = g.Describe("[sig-auth][Feature:LDAP][Serial] ldap group sync", func() { _, err = oc.AsAdmin().Run("adm").Args("policy", "add-scc-to-user", "anyuid", oc.Username()).Output() o.Expect(err).NotTo(o.HaveOccurred()) - pod, err := exutil.NewPodExecutor(oc, "groupsync", "fedora:29") + pod, err := exutil.NewPodExecutor(oc, "groupsync", image.OpenLDAPTestImage()) o.Expect(err).NotTo(o.HaveOccurred()) // Install stuff needed for the exec pod to run groupsync.sh and hack/lib for i := 0; i < 5; i++ { - if _, err = pod.Exec("dnf install -y findutils golang docker which bc openldap-clients"); err == nil { + if _, err = pod.Exec("yum install -y findutils golang docker which bc openldap-clients"); err == nil { break } // it apparently hit error syncing caches, clean all to try again - pod.Exec("dnf clean all") + pod.Exec("yum clean all") } o.Expect(err).NotTo(o.HaveOccurred()) diff --git a/test/extended/prometheus/prometheus.go b/test/extended/prometheus/prometheus.go index 23e859171924..f3edb2546b27 100644 --- a/test/extended/prometheus/prometheus.go +++ b/test/extended/prometheus/prometheus.go @@ -57,7 +57,7 @@ var _ = g.Describe("[sig-instrumentation][Late] Alerts", func() { } oc.SetupProject() ns := oc.Namespace() - execPod := exutil.CreateUbiExecPodOrFail(oc.AdminKubeClient(), ns, "execpod", nil) + execPod := exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod") defer func() { oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPod.Name, *metav1.NewDeleteOptions(1)) }() @@ -75,7 +75,7 @@ var _ = g.Describe("[sig-instrumentation][Late] Alerts", func() { g.It("should have a Watchdog alert in firing state the entire cluster run", func() { oc.SetupProject() ns := oc.Namespace() - execPod := exutil.CreateUbiExecPodOrFail(oc.AdminKubeClient(), ns, "execpod", nil) + execPod := exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod") defer func() { oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPod.Name, *metav1.NewDeleteOptions(1)) }() @@ -97,7 +97,7 @@ var _ = g.Describe("[sig-instrumentation][Late] Alerts", func() { oc.SetupProject() ns := oc.Namespace() - execPod := exutil.CreateUbiExecPodOrFail(oc.AdminKubeClient(), ns, "execpod", nil) + execPod := exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod") defer func() { oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPod.Name, *metav1.NewDeleteOptions(1)) }() @@ -138,7 +138,7 @@ var _ = g.Describe("[sig-instrumentation] Prometheus", func() { oc.SetupProject() ns := oc.Namespace() - execPod := exutil.CreateUbiExecPodOrFail(oc.AdminKubeClient(), ns, "execpod", nil) + execPod := exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod") defer func() { oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPod.Name, *metav1.NewDeleteOptions(1)) }() @@ -163,7 +163,7 @@ var _ = g.Describe("[sig-instrumentation] Prometheus", func() { g.It("should start and expose a secured proxy and unsecured metrics", func() { oc.SetupProject() ns := oc.Namespace() - execPod := exutil.CreateUbiExecPodOrFail(oc.AdminKubeClient(), ns, "execpod", nil) + execPod := exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod") defer func() { oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPod.Name, *metav1.NewDeleteOptions(1)) }() @@ -290,7 +290,7 @@ var _ = g.Describe("[sig-instrumentation] Prometheus", func() { g.It("should have a AlertmanagerReceiversNotConfigured alert in firing state", func() { oc.SetupProject() ns := oc.Namespace() - execPod := exutil.CreateUbiExecPodOrFail(oc.AdminKubeClient(), ns, "execpod", nil) + execPod := exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod") defer func() { oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPod.Name, *metav1.NewDeleteOptions(1)) }() @@ -306,7 +306,7 @@ var _ = g.Describe("[sig-instrumentation] Prometheus", func() { g.It("should have important platform topology metrics", func() { oc.SetupProject() ns := oc.Namespace() - execPod := exutil.CreateUbiExecPodOrFail(oc.AdminKubeClient(), ns, "execpod", nil) + execPod := exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod") defer func() { oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPod.Name, *metav1.NewDeleteOptions(1)) }() @@ -332,7 +332,7 @@ var _ = g.Describe("[sig-instrumentation] Prometheus", func() { g.It("should have non-Pod host cAdvisor metrics", func() { oc.SetupProject() ns := oc.Namespace() - execPod := exutil.CreateUbiExecPodOrFail(oc.AdminKubeClient(), ns, "execpod", nil) + execPod := exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod") defer func() { oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPod.Name, *metav1.NewDeleteOptions(1)) }() @@ -346,7 +346,7 @@ var _ = g.Describe("[sig-instrumentation] Prometheus", func() { g.It("shouldn't have failing rules evaluation", func() { oc.SetupProject() ns := oc.Namespace() - execPod := exutil.CreateUbiExecPodOrFail(oc.AdminKubeClient(), ns, "execpod", nil) + execPod := exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod") defer func() { oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPod.Name, *metav1.NewDeleteOptions(1)) }() @@ -361,7 +361,7 @@ var _ = g.Describe("[sig-instrumentation] Prometheus", func() { g.It("should be able to get the sdn ovs flows", func() { oc.SetupProject() ns := oc.Namespace() - execPod := exutil.CreateUbiExecPodOrFail(oc.AdminKubeClient(), ns, "execpod", nil) + execPod := exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod") defer func() { oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPod.Name, *metav1.NewDeleteOptions(1)) }() @@ -380,7 +380,7 @@ var _ = g.Describe("[sig-instrumentation] Prometheus", func() { } oc.SetupProject() ns := oc.Namespace() - execPod := exutil.CreateUbiExecPodOrFail(oc.AdminKubeClient(), ns, "execpod", nil) + execPod := exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod") defer func() { oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPod.Name, *metav1.NewDeleteOptions(1)) }() @@ -396,7 +396,7 @@ var _ = g.Describe("[sig-instrumentation] Prometheus", func() { oc.SetupProject() ns := oc.Namespace() - execPod := exutil.CreateUbiExecPodOrFail(oc.AdminKubeClient(), ns, "execpod", nil) + execPod := exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod") defer func() { oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPod.Name, *metav1.NewDeleteOptions(1)) }() @@ -444,7 +444,7 @@ var _ = g.Describe("[sig-instrumentation] Prometheus", func() { o.Expect(err).NotTo(o.HaveOccurred()) }() - execPod := exutil.CreateUbiExecPodOrFail(oc.AdminKubeClient(), ns, "execpod", func(pod *v1.Pod) { + execPod := exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod", func(pod *v1.Pod) { pod.Annotations = map[string]string{ "k8s.v1.cni.cncf.io/networks": "secondary", } diff --git a/test/extended/prometheus/prometheus_builds.go b/test/extended/prometheus/prometheus_builds.go index e052aa42c388..5be6d0927750 100644 --- a/test/extended/prometheus/prometheus_builds.go +++ b/test/extended/prometheus/prometheus_builds.go @@ -52,7 +52,7 @@ var _ = g.Describe("[sig-instrumentation][sig-builds][Feature:Builds] Prometheus ns := oc.Namespace() appTemplate := exutil.FixturePath("testdata", "builds", "build-pruning", "successful-build-config.yaml") - execPod := exutil.CreateUbiExecPodOrFail(oc.AdminKubeClient(), ns, "execpod", nil) + execPod := exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod") defer func() { oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPod.Name, *metav1.NewDeleteOptions(1)) }() diff --git a/test/extended/prometheus/storage.go b/test/extended/prometheus/storage.go index 82e0f6a28535..e02856a2a842 100644 --- a/test/extended/prometheus/storage.go +++ b/test/extended/prometheus/storage.go @@ -46,7 +46,7 @@ func checkOperation(oc *exutil.CLI, url string, bearerToken string, component st plugins := []string{"kubernetes.io/azure-disk", "kubernetes.io/aws-ebs", "kubernetes.io/gce-pd", "kubernetes.io/cinder", "kubernetes.io/vsphere-volume"} oc.SetupProject() ns := oc.Namespace() - execPod := exutil.CreateUbiExecPodOrFail(oc.AdminKubeClient(), ns, "execpod", nil) + execPod := exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod") defer func() { oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPod.Name, *metav1.NewDeleteOptions(1)) }() diff --git a/test/extended/router/config_manager.go b/test/extended/router/config_manager.go index 9269a4bc5caa..a1bb7da85fb8 100644 --- a/test/extended/router/config_manager.go +++ b/test/extended/router/config_manager.go @@ -55,9 +55,9 @@ var _ = g.Describe("[sig-network][Feature:Router]", func() { g.It("should serve the correct routes when running with the haproxy config manager", func() { g.Skip("TODO: This test is flaking, fix it") ns := oc.KubeFramework().Namespace.Name - execPodName := exutil.CreateExecPodOrFail(oc.AdminKubeClient().CoreV1(), ns, "execpod") + execPod := exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod") defer func() { - oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPodName, *metav1.NewDeleteOptions(1)) + oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPod.Name, *metav1.NewDeleteOptions(1)) }() g.By(fmt.Sprintf("creating a router with haproxy config manager from a config file %q", configPath)) @@ -78,15 +78,15 @@ var _ = g.Describe("[sig-network][Feature:Router]", func() { g.By("waiting for the healthz endpoint to respond") healthzURI := fmt.Sprintf("http://%s:1936/healthz", routerIP) - err = waitForRouterOKResponseExec(ns, execPodName, healthzURI, routerIP, timeoutSeconds) + err = waitForRouterOKResponseExec(ns, execPod.Name, healthzURI, routerIP, timeoutSeconds) o.Expect(err).NotTo(o.HaveOccurred()) g.By("waiting for the valid routes to respond") - err = waitForRouteToRespond(ns, execPodName, "http", "insecure.hapcm.test", "/", routerIP, 0) + err = waitForRouteToRespond(ns, execPod.Name, "http", "insecure.hapcm.test", "/", routerIP, 0) o.Expect(err).NotTo(o.HaveOccurred()) for _, host := range []string{"edge.allow.hapcm.test", "reencrypt.hapcm.test", "passthrough.hapcm.test"} { - err = waitForRouteToRespond(ns, execPodName, "https", host, "/", routerIP, 0) + err = waitForRouteToRespond(ns, execPod.Name, "https", host, "/", routerIP, 0) o.Expect(err).NotTo(o.HaveOccurred()) } @@ -97,7 +97,7 @@ var _ = g.Describe("[sig-network][Feature:Router]", func() { err := oc.AsAdmin().Run("expose").Args("service", "insecure-service", "--name", name, "--hostname", hostName, "--labels", "select=haproxy-cfgmgr").Execute() o.Expect(err).NotTo(o.HaveOccurred()) - err = waitForRouteToRespond(ns, execPodName, "http", hostName, "/", routerIP, 0) + err = waitForRouteToRespond(ns, execPod.Name, "http", hostName, "/", routerIP, 0) o.Expect(err).NotTo(o.HaveOccurred()) err = oc.AsAdmin().Run("delete").Args("route", name).Execute() @@ -117,7 +117,7 @@ var _ = g.Describe("[sig-network][Feature:Router]", func() { err = oc.AsAdmin().Run("label").Args("route", name, "select=haproxy-cfgmgr").Execute() o.Expect(err).NotTo(o.HaveOccurred()) - err = waitForRouteToRespond(ns, execPodName, "https", hostName, "/", routerIP, 0) + err = waitForRouteToRespond(ns, execPod.Name, "https", hostName, "/", routerIP, 0) o.Expect(err).NotTo(o.HaveOccurred()) err = oc.AsAdmin().Run("delete").Args("route", name).Execute() diff --git a/test/extended/router/headers.go b/test/extended/router/headers.go index 3158a3beee9c..0b16ef2defab 100644 --- a/test/extended/router/headers.go +++ b/test/extended/router/headers.go @@ -68,9 +68,9 @@ var _ = g.Describe("[sig-network][Feature:Router]", func() { }() ns := oc.KubeFramework().Namespace.Name - execPodName := exutil.CreateExecPodOrFail(oc.AdminKubeClient().CoreV1(), ns, "execpod") + execPod := exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod") defer func() { - oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPodName, *metav1.NewDeleteOptions(1)) + oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPod.Name, *metav1.NewDeleteOptions(1)) }() g.By(fmt.Sprintf("creating an http echo server from a config file %q", configPath)) @@ -98,17 +98,17 @@ var _ = g.Describe("[sig-network][Feature:Router]", func() { g.By("waiting for the healthz endpoint to respond") healthzURI := fmt.Sprintf("http://%s:1936/healthz", metricsIP) - err = waitForRouterOKResponseExec(ns, execPodName, healthzURI, metricsIP, changeTimeoutSeconds) + err = waitForRouterOKResponseExec(ns, execPod.Name, healthzURI, metricsIP, changeTimeoutSeconds) o.Expect(err).NotTo(o.HaveOccurred()) host := "router-headers.example.com" g.By(fmt.Sprintf("waiting for the route to become active")) - err = waitForRouterOKResponseExec(ns, execPodName, routerURL, host, changeTimeoutSeconds) + err = waitForRouterOKResponseExec(ns, execPod.Name, routerURL, host, changeTimeoutSeconds) o.Expect(err).NotTo(o.HaveOccurred()) g.By(fmt.Sprintf("making a request and reading back the echoed headers")) var payload string - payload, err = getRoutePayloadExec(ns, execPodName, routerURL, host) + payload, err = getRoutePayloadExec(ns, execPod.Name, routerURL, host) o.Expect(err).NotTo(o.HaveOccurred()) // The trailing \n is being stripped, so add it back diff --git a/test/extended/router/metrics.go b/test/extended/router/metrics.go index cd6b5f0e669b..482782fe6c85 100644 --- a/test/extended/router/metrics.go +++ b/test/extended/router/metrics.go @@ -96,7 +96,7 @@ var _ = g.Describe("[sig-network][Feature:Router]", func() { g.Describe("The HAProxy router", func() { g.It("should expose a health check on the metrics port", func() { - execPodName = exutil.CreateExecPodOrFail(oc.AdminKubeClient().CoreV1(), ns, "execpod") + execPodName = exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod").Name defer func() { oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPodName, *metav1.NewDeleteOptions(1)) }() @@ -112,7 +112,7 @@ var _ = g.Describe("[sig-network][Feature:Router]", func() { err := oc.Run("create").Args("-f", configPath).Execute() o.Expect(err).NotTo(o.HaveOccurred()) - execPodName = exutil.CreateExecPodOrFail(oc.AdminKubeClient().CoreV1(), ns, "execpod") + execPodName = exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod").Name defer func() { oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPodName, *metav1.NewDeleteOptions(1)) }() @@ -288,7 +288,7 @@ var _ = g.Describe("[sig-network][Feature:Router]", func() { }) g.It("should expose the profiling endpoints", func() { - execPodName = exutil.CreateExecPodOrFail(oc.AdminKubeClient().CoreV1(), ns, "execpod") + execPodName = exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod").Name defer func() { oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPodName, *metav1.NewDeleteOptions(1)) }() @@ -309,7 +309,7 @@ var _ = g.Describe("[sig-network][Feature:Router]", func() { g.Skip("prometheus not found on this cluster") } - execPod := exutil.CreateUbiExecPodOrFail(oc.AdminKubeClient(), ns, "execpod", nil) + execPod := exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod") defer func() { oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPod.Name, *metav1.NewDeleteOptions(1)) }() diff --git a/test/extended/router/reencrypt.go b/test/extended/router/reencrypt.go index 67ef4fc6242f..de5f098347f1 100644 --- a/test/extended/router/reencrypt.go +++ b/test/extended/router/reencrypt.go @@ -50,9 +50,9 @@ var _ = g.Describe("[sig-network][Feature:Router]", func() { g.It("should support reencrypt to services backed by a serving certificate automatically", func() { routerURL := fmt.Sprintf("https://%s", ip) - execPodName := exutil.CreateExecPodOrFail(oc.AdminKubeClient().CoreV1(), ns, "execpod") + execPod := exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod") defer func() { - oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPodName, *metav1.NewDeleteOptions(1)) + oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPod.Name, *metav1.NewDeleteOptions(1)) }() g.By(fmt.Sprintf("deploying a service using a reencrypt route without a destinationCACertificate")) err := oc.Run("create").Args("-f", configPath).Execute() @@ -73,7 +73,7 @@ var _ = g.Describe("[sig-network][Feature:Router]", func() { o.Expect(err).NotTo(o.HaveOccurred()) // don't assume the router is available via external DNS, because of complexity - err = waitForRouterOKResponseExec(ns, execPodName, routerURL, hostname, changeTimeoutSeconds) + err = waitForRouterOKResponseExec(ns, execPod.Name, routerURL, hostname, changeTimeoutSeconds) o.Expect(err).NotTo(o.HaveOccurred()) }) }) diff --git a/test/extended/router/scoped.go b/test/extended/router/scoped.go index bf5817d32e02..7f03e1274c73 100644 --- a/test/extended/router/scoped.go +++ b/test/extended/router/scoped.go @@ -67,9 +67,9 @@ var _ = g.Describe("[sig-network][Feature:Router]", func() { o.Expect(err).NotTo(o.HaveOccurred()) ns := oc.KubeFramework().Namespace.Name - execPodName := exutil.CreateExecPodOrFail(oc.AdminKubeClient().CoreV1(), ns, "execpod") + execPod := exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod") defer func() { - oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPodName, *metav1.NewDeleteOptions(1)) + oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPod.Name, *metav1.NewDeleteOptions(1)) }() var routerIP string @@ -91,16 +91,16 @@ var _ = g.Describe("[sig-network][Feature:Router]", func() { g.By("waiting for the healthz endpoint to respond") healthzURI := fmt.Sprintf("http://%s:1936/healthz", routerIP) - err = waitForRouterOKResponseExec(ns, execPodName, healthzURI, routerIP, changeTimeoutSeconds) + err = waitForRouterOKResponseExec(ns, execPod.Name, healthzURI, routerIP, changeTimeoutSeconds) o.Expect(err).NotTo(o.HaveOccurred()) g.By("waiting for the valid route to respond") - err = waitForRouterOKResponseExec(ns, execPodName, routerURL+"/Letter", "FIRST.example.com", changeTimeoutSeconds) + err = waitForRouterOKResponseExec(ns, execPod.Name, routerURL+"/Letter", "FIRST.example.com", changeTimeoutSeconds) o.Expect(err).NotTo(o.HaveOccurred()) for _, host := range []string{"second.example.com", "third.example.com"} { g.By(fmt.Sprintf("checking that %s does not match a route", host)) - err = expectRouteStatusCodeExec(ns, execPodName, routerURL+"/Letter", host, http.StatusServiceUnavailable) + err = expectRouteStatusCodeExec(ns, execPod.Name, routerURL+"/Letter", host, http.StatusServiceUnavailable) o.Expect(err).NotTo(o.HaveOccurred()) } }) @@ -113,9 +113,9 @@ var _ = g.Describe("[sig-network][Feature:Router]", func() { o.Expect(err).NotTo(o.HaveOccurred()) ns := oc.KubeFramework().Namespace.Name - execPodName := exutil.CreateExecPodOrFail(oc.AdminKubeClient().CoreV1(), ns, "execpod") + execPod := exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod") defer func() { - oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPodName, *metav1.NewDeleteOptions(1)) + oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPod.Name, *metav1.NewDeleteOptions(1)) }() var routerIP string @@ -139,22 +139,22 @@ var _ = g.Describe("[sig-network][Feature:Router]", func() { g.By("waiting for the healthz endpoint to respond") healthzURI := fmt.Sprintf("http://%s:1936/healthz", routerIP) - err = waitForRouterOKResponseExec(ns, execPodName, healthzURI, routerIP, changeTimeoutSeconds) + err = waitForRouterOKResponseExec(ns, execPod.Name, healthzURI, routerIP, changeTimeoutSeconds) o.Expect(err).NotTo(o.HaveOccurred()) g.By("waiting for the valid route to respond") - err = waitForRouterOKResponseExec(ns, execPodName, routerURL+"/Letter", fmt.Sprintf(pattern, "route-1", ns), changeTimeoutSeconds) + err = waitForRouterOKResponseExec(ns, execPod.Name, routerURL+"/Letter", fmt.Sprintf(pattern, "route-1", ns), changeTimeoutSeconds) o.Expect(err).NotTo(o.HaveOccurred()) g.By("checking that the stored domain name does not match a route") host := "first.example.com" - err = expectRouteStatusCodeExec(ns, execPodName, routerURL+"/Letter", host, http.StatusServiceUnavailable) + err = expectRouteStatusCodeExec(ns, execPod.Name, routerURL+"/Letter", host, http.StatusServiceUnavailable) o.Expect(err).NotTo(o.HaveOccurred()) for _, host := range []string{"route-1", "route-2"} { host = fmt.Sprintf(pattern, host, ns) g.By(fmt.Sprintf("checking that %s matches a route", host)) - err = expectRouteStatusCodeExec(ns, execPodName, routerURL+"/Letter", host, http.StatusOK) + err = expectRouteStatusCodeExec(ns, execPod.Name, routerURL+"/Letter", host, http.StatusOK) o.Expect(err).NotTo(o.HaveOccurred()) } @@ -178,9 +178,9 @@ var _ = g.Describe("[sig-network][Feature:Router]", func() { o.Expect(err).NotTo(o.HaveOccurred()) ns := oc.KubeFramework().Namespace.Name - execPodName := exutil.CreateExecPodOrFail(oc.AdminKubeClient().CoreV1(), ns, "execpod") + execPod := exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod") defer func() { - oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPodName, *metav1.NewDeleteOptions(1)) + oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPod.Name, *metav1.NewDeleteOptions(1)) }() g.By(fmt.Sprintf("creating a scoped router with overridden domains from a config file %q", configPath)) @@ -206,22 +206,22 @@ var _ = g.Describe("[sig-network][Feature:Router]", func() { g.By("waiting for the healthz endpoint to respond") healthzURI := fmt.Sprintf("http://%s:1936/healthz", routerIP) - err = waitForRouterOKResponseExec(ns, execPodName, healthzURI, routerIP, changeTimeoutSeconds) + err = waitForRouterOKResponseExec(ns, execPod.Name, healthzURI, routerIP, changeTimeoutSeconds) o.Expect(err).NotTo(o.HaveOccurred()) g.By("waiting for the valid route to respond") - err = waitForRouterOKResponseExec(ns, execPodName, routerURL+"/Letter", fmt.Sprintf(pattern, "route-override-domain-1", ns), changeTimeoutSeconds) + err = waitForRouterOKResponseExec(ns, execPod.Name, routerURL+"/Letter", fmt.Sprintf(pattern, "route-override-domain-1", ns), changeTimeoutSeconds) o.Expect(err).NotTo(o.HaveOccurred()) g.By("checking that the stored domain name does not match a route") host := "y.a.null.ptr" - err = expectRouteStatusCodeExec(ns, execPodName, routerURL+"/Letter", host, http.StatusServiceUnavailable) + err = expectRouteStatusCodeExec(ns, execPod.Name, routerURL+"/Letter", host, http.StatusServiceUnavailable) o.Expect(err).NotTo(o.HaveOccurred()) for _, host := range []string{"route-override-domain-1", "route-override-domain-2"} { host = fmt.Sprintf(pattern, host, ns) g.By(fmt.Sprintf("checking that %s matches a route", host)) - err = expectRouteStatusCodeExec(ns, execPodName, routerURL+"/Letter", host, http.StatusOK) + err = expectRouteStatusCodeExec(ns, execPod.Name, routerURL+"/Letter", host, http.StatusOK) o.Expect(err).NotTo(o.HaveOccurred()) } diff --git a/test/extended/router/unprivileged.go b/test/extended/router/unprivileged.go index e4de8018075d..c9725cf00894 100644 --- a/test/extended/router/unprivileged.go +++ b/test/extended/router/unprivileged.go @@ -64,9 +64,9 @@ var _ = g.Describe("[sig-network][Feature:Router]", func() { o.Expect(err).NotTo(o.HaveOccurred()) ns := oc.KubeFramework().Namespace.Name - execPodName := exutil.CreateExecPodOrFail(oc.AdminKubeClient().CoreV1(), ns, "execpod") + execPod := exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod") defer func() { - oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPodName, *metav1.NewDeleteOptions(1)) + oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPod.Name, *metav1.NewDeleteOptions(1)) }() var routerIP string @@ -88,16 +88,16 @@ var _ = g.Describe("[sig-network][Feature:Router]", func() { g.By("waiting for the healthz endpoint to respond") healthzURI := fmt.Sprintf("http://%s:1936/healthz", routerIP) - err = waitForRouterOKResponseExec(ns, execPodName, healthzURI, routerIP, changeTimeoutSeconds) + err = waitForRouterOKResponseExec(ns, execPod.Name, healthzURI, routerIP, changeTimeoutSeconds) o.Expect(err).NotTo(o.HaveOccurred()) g.By("waiting for the valid route to respond") - err = waitForRouterOKResponseExec(ns, execPodName, routerURL+"/Letter", "FIRST.example.com", changeTimeoutSeconds) + err = waitForRouterOKResponseExec(ns, execPod.Name, routerURL+"/Letter", "FIRST.example.com", changeTimeoutSeconds) o.Expect(err).NotTo(o.HaveOccurred()) for _, host := range []string{"second.example.com", "third.example.com"} { g.By(fmt.Sprintf("checking that %s does not match a route", host)) - err = expectRouteStatusCodeExec(ns, execPodName, routerURL+"/Letter", host, http.StatusServiceUnavailable) + err = expectRouteStatusCodeExec(ns, execPod.Name, routerURL+"/Letter", host, http.StatusServiceUnavailable) o.Expect(err).NotTo(o.HaveOccurred()) } diff --git a/test/extended/router/weighted.go b/test/extended/router/weighted.go index 1ae4e9359127..ecf04494ba2c 100644 --- a/test/extended/router/weighted.go +++ b/test/extended/router/weighted.go @@ -44,9 +44,9 @@ var _ = g.Describe("[sig-network][Feature:Router]", func() { }() ns := oc.KubeFramework().Namespace.Name - execPodName := exutil.CreateExecPodOrFail(oc.AdminKubeClient().CoreV1(), ns, "execpod") + execPod := exutil.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod") defer func() { - oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPodName, *metav1.NewDeleteOptions(1)) + oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPod.Name, *metav1.NewDeleteOptions(1)) }() g.By(fmt.Sprintf("creating a weighted router from a config file %q", configPath)) @@ -71,24 +71,24 @@ var _ = g.Describe("[sig-network][Feature:Router]", func() { g.By("waiting for the healthz endpoint to respond") healthzURI := fmt.Sprintf("http://%s:1936/healthz", routerIP) - err = waitForRouterOKResponseExec(ns, execPodName, healthzURI, routerIP, changeTimeoutSeconds) + err = waitForRouterOKResponseExec(ns, execPod.Name, healthzURI, routerIP, changeTimeoutSeconds) o.Expect(err).NotTo(o.HaveOccurred()) host := "weighted.example.com" times := 100 g.By(fmt.Sprintf("checking that %d requests go through successfully", times)) // wait for the request to stabilize - err = waitForRouterOKResponseExec(ns, execPodName, routerURL, "weighted.example.com", changeTimeoutSeconds) + err = waitForRouterOKResponseExec(ns, execPod.Name, routerURL, "weighted.example.com", changeTimeoutSeconds) o.Expect(err).NotTo(o.HaveOccurred()) // all requests should now succeed - err = expectRouteStatusCodeRepeatedExec(ns, execPodName, routerURL, "weighted.example.com", http.StatusOK, times, false) + err = expectRouteStatusCodeRepeatedExec(ns, execPod.Name, routerURL, "weighted.example.com", http.StatusOK, times, false) o.Expect(err).NotTo(o.HaveOccurred()) g.By(fmt.Sprintf("checking that there are three weighted backends in the router stats")) var trafficValues []string err = wait.PollImmediate(100*time.Millisecond, changeTimeoutSeconds*time.Second, func() (bool, error) { statsURL := fmt.Sprintf("http://%s:1936/;csv", routerIP) - stats, err := getAuthenticatedRouteURLViaPod(ns, execPodName, statsURL, host, "admin", "password") + stats, err := getAuthenticatedRouteURLViaPod(ns, execPod.Name, statsURL, host, "admin", "password") o.Expect(err).NotTo(o.HaveOccurred()) trafficValues, err = parseStats(stats, "weightedroute", 7) o.Expect(err).NotTo(o.HaveOccurred()) @@ -108,7 +108,7 @@ var _ = g.Describe("[sig-network][Feature:Router]", func() { g.By(fmt.Sprintf("checking that zero weights are also respected by the router")) host = "zeroweight.example.com" - err = expectRouteStatusCodeExec(ns, execPodName, routerURL, host, http.StatusServiceUnavailable) + err = expectRouteStatusCodeExec(ns, execPod.Name, routerURL, host, http.StatusServiceUnavailable) o.Expect(err).NotTo(o.HaveOccurred()) }) }) diff --git a/test/extended/security/scc.go b/test/extended/security/scc.go index 739c443abb5f..3e8b15b00c63 100644 --- a/test/extended/security/scc.go +++ b/test/extended/security/scc.go @@ -11,6 +11,7 @@ import ( securityv1client "github.com/openshift/client-go/security/clientset/versioned/typed/security/v1" "github.com/openshift/origin/test/extended/authorization" exutil "github.com/openshift/origin/test/extended/util" + "github.com/openshift/origin/test/extended/util/image" kubeauthorizationv1 "k8s.io/api/authorization/v1" corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" @@ -266,7 +267,7 @@ var _ = g.Describe("[sig-auth][Feature:SecurityContextConstraints] ", func() { g.It("TestPodDefaultCapabilities", func() { g.By("Running a restricted pod and getting it's inherited capabilities") - pod, err := exutil.NewPodExecutor(oc, "restrictedcapsh", "fedora:29") + pod, err := exutil.NewPodExecutor(oc, "restrictedcapsh", image.ShellImage()) o.Expect(err).NotTo(o.HaveOccurred()) desiredCapabilities := "000000000000051b" @@ -298,6 +299,9 @@ func getPrivilegedPod(name string) *corev1.Pod { return &corev1.Pod{ ObjectMeta: metav1.ObjectMeta{Name: name}, Spec: corev1.PodSpec{ + NodeSelector: map[string]string{ + "e2e.openshift.io/unschedulable": "should-not-run", + }, Containers: []corev1.Container{ {Name: "first", Image: "something-innocuous"}, }, diff --git a/test/extended/security/supplemental_groups.go b/test/extended/security/supplemental_groups.go index 5afd1f191e57..b2360a08d929 100644 --- a/test/extended/security/supplemental_groups.go +++ b/test/extended/security/supplemental_groups.go @@ -18,6 +18,7 @@ import ( e2epod "k8s.io/kubernetes/test/e2e/framework/pod" exutil "github.com/openshift/origin/test/extended/util" + "github.com/openshift/origin/test/extended/util/image" ) const ( @@ -103,7 +104,7 @@ func supGroupPod(fsGroup int64, supGroup int64) *kapiv1.Pod { Containers: []kapiv1.Container{ { Name: supplementalGroupsPod, - Image: "openshift/origin-pod", + Image: image.ShellImage(), }, }, }, diff --git a/test/extended/testdata/bindata.go b/test/extended/testdata/bindata.go index 4b4880762c87..e1c2183748b8 100644 --- a/test/extended/testdata/bindata.go +++ b/test/extended/testdata/bindata.go @@ -18863,7 +18863,7 @@ var _testExtendedTestdataBuildsApplicationTemplateCustombuildJson = []byte(`{ "containers": [ { "name": "ruby-helloworld-database", - "image": "centos/mysql-57-centos7:latest", + "image": "image-registry.openshift-image-registry.svc:5000/openshift/mysql:5.7", "ports": [ { "containerPort": 3306, @@ -18983,7 +18983,7 @@ items: runPolicy: Serial source: dockerfile: | - FROM busybox:latest + FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest strategy: type: Docker dockerStrategy: @@ -19474,7 +19474,7 @@ func testExtendedTestdataBuildsBuildQuotaS2iBinAssemble() (*asset, error) { return a, nil } -var _testExtendedTestdataBuildsBuildQuotaDockerfile = []byte(`FROM centos:7 +var _testExtendedTestdataBuildsBuildQuotaDockerfile = []byte(`FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest USER root ADD .s2i/bin/assemble . @@ -19500,7 +19500,7 @@ func testExtendedTestdataBuildsBuildQuotaDockerfile() (*asset, error) { return a, nil } -var _testExtendedTestdataBuildsBuildSecretsDockerfile = []byte(`FROM docker.io/busybox +var _testExtendedTestdataBuildsBuildSecretsDockerfile = []byte(`FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest USER root ADD ./secret-dir /secrets @@ -19794,7 +19794,7 @@ var _testExtendedTestdataBuildsBuildSecretsTestDockerBuildJson = []byte(`{ "dockerStrategy": { "from": { "kind": "DockerImage", - "name": "quay.io/quay/busybox:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" }, "env": [ { @@ -19899,7 +19899,7 @@ var _testExtendedTestdataBuildsBuildSecretsTestS2iBuildJson = []byte(`{ "sourceStrategy": { "from": { "kind": "DockerImage", - "name": "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" }, "env": [ { @@ -20112,7 +20112,7 @@ var _testExtendedTestdataBuildsBuildTimingTestDockerBuildJson = []byte(`{ "forcePull": true, "from": { "kind": "DockerImage", - "name": "quay.io/quay/busybox:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" }, "env": [ { @@ -20353,7 +20353,7 @@ func testExtendedTestdataBuildsCustomBuildDockerfile() (*asset, error) { return a, nil } -var _testExtendedTestdataBuildsCustomBuildDockerfileSample = []byte(`FROM docker.io/centos:7 +var _testExtendedTestdataBuildsCustomBuildDockerfileSample = []byte(`FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest RUN touch /tmp/built `) @@ -20373,19 +20373,26 @@ func testExtendedTestdataBuildsCustomBuildDockerfileSample() (*asset, error) { } var _testExtendedTestdataBuildsCustomBuildBuildSh = []byte(`#!/bin/sh + +set -euo pipefail + # Note that in this case the build inputs are part of the custom builder image, but normally this # would be retrieved from an external source. cd /tmp/input # OUTPUT_REGISTRY and OUTPUT_IMAGE are env variables provided by the custom # build framework TAG="${OUTPUT_REGISTRY}/${OUTPUT_IMAGE}" -# performs the build of the new image defined by Dockerfile.sample -buildah --storage-driver vfs bud --isolation chroot -t ${TAG} . + +cp -R /var/run/configs/openshift.io/certs/certs.d/* /etc/containers/certs.d/ + # buildah requires a slight modification to the push secret provided by the service account in order to use it for pushing the image -cp /var/run/secrets/openshift.io/push/.dockercfg /tmp -(echo "{ \"auths\": " ; cat /var/run/secrets/openshift.io/push/.dockercfg ; echo "}") > /tmp/.dockercfg +echo "{ \"auths\": $(cat /var/run/secrets/openshift.io/pull/.dockercfg)}" > /tmp/.pull +echo "{ \"auths\": $(cat /var/run/secrets/openshift.io/push/.dockercfg)}" > /tmp/.push + +# performs the build of the new image defined by Dockerfile.sample +buildah --authfile /tmp/.pull --storage-driver vfs bud --isolation chroot -t ${TAG} . # push the new image to the target for the build -buildah --storage-driver vfs push --tls-verify=false --authfile /tmp/.dockercfg ${TAG} +buildah --authfile /tmp/.push --storage-driver vfs push ${TAG} `) @@ -20404,7 +20411,7 @@ func testExtendedTestdataBuildsCustomBuildBuildSh() (*asset, error) { return a, nil } -var _testExtendedTestdataBuildsDockerAddDockerfile = []byte(`FROM centos:7 +var _testExtendedTestdataBuildsDockerAddDockerfile = []byte(`FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest ADD no-exist-file . `) @@ -20510,7 +20517,7 @@ var _testExtendedTestdataBuildsIncrementalAuthBuildJson = []byte(`{ ], "from": { "kind": "DockerImage", - "name": "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" }, "incremental": true } @@ -20558,7 +20565,7 @@ spec: sourceStrategy: from: kind: DockerImage - name: registry.redhat.io/rhscl/nodejs-10-rhel7:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/nodejs:10 `) func testExtendedTestdataBuildsPullsecretLinkedNodejsBcYamlBytes() ([]byte, error) { @@ -20699,7 +20706,7 @@ spec: sourceStrategy: from: kind: DockerImage - name: registry.redhat.io/rhscl/ruby-25-rhel7:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5 `) func testExtendedTestdataBuildsStatusfailBadcontextdirs2iYamlBytes() ([]byte, error) { @@ -20799,7 +20806,7 @@ spec: dockerStrategy: from: kind: DockerImage - name: registry.redhat.io/rhscl/ruby-25-rhel7:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5 `) func testExtendedTestdataBuildsStatusfailFetchimagecontentdockerYamlBytes() ([]byte, error) { @@ -20830,7 +20837,7 @@ spec: dockerStrategy: from: kind: DockerImage - name: registry.redhat.io/rhscl/ruby-25-rhel7:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5 `) func testExtendedTestdataBuildsStatusfailFetchsourcedockerYamlBytes() ([]byte, error) { @@ -20861,7 +20868,7 @@ spec: sourceStrategy: from: kind: DockerImage - name: registry.redhat.io/rhscl/ruby-25-rhel7:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5 `) func testExtendedTestdataBuildsStatusfailFetchsources2iYamlBytes() ([]byte, error) { @@ -20892,7 +20899,7 @@ spec: sourceStrategy: from: kind: DockerImage - name: registry.redhat.io/rhscl/ruby-25-rhel7:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5 scripts: "http://example.org/scripts" env: - name: http_proxy @@ -20930,7 +20937,7 @@ spec: sourceStrategy: from: kind: DockerImage - name: registry.redhat.io/rhscl/ruby-25-rhel7:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5 forcePull: true `) @@ -21428,7 +21435,7 @@ items: dockerStrategy: from: kind: DockerImage - name: registry.redhat.io/rhscl/ruby-25-rhel7:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5 env: - name: SOME_HTTP_PROXY value: https://envuser:password@proxy3.com @@ -21554,7 +21561,7 @@ items: value: '5' from: kind: DockerImage - name: registry.redhat.io/rhscl/ruby-25-rhel7:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5 resources: {} status: lastVersion: 0 @@ -21583,7 +21590,7 @@ items: value: '5' from: kind: DockerImage - name: registry.redhat.io/rhscl/ruby-25-rhel7:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5 resources: {} status: lastVersion: 0 @@ -21611,7 +21618,7 @@ items: value: '5' from: kind: DockerImage - name: registry.redhat.io/rhscl/ruby-25-rhel7:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5 resources: {} status: lastVersion: 0 @@ -21640,7 +21647,7 @@ items: value: '5' from: kind: DockerImage - name: registry.redhat.io/rhscl/ruby-25-rhel7:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5 resources: {} status: lastVersion: 0 @@ -21668,7 +21675,7 @@ items: value: '5' from: kind: DockerImage - name: registry.redhat.io/rhscl/ruby-25-rhel7:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5 resources: {} nodeSelector: nodelabelkey: nodelabelvalue @@ -21694,7 +21701,7 @@ items: dockerStrategy: from: kind: DockerImage - name: quay.io/quay/busybox:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest resources: {} postCommit: {} nodeSelector: @@ -21720,7 +21727,7 @@ items: dockerStrategy: from: kind: DockerImage - name: quay.io/quay/busybox:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest buildArgs: - name: foofoo value: default @@ -21864,14 +21871,14 @@ var _testExtendedTestdataBuildsTestCdsDockerbuildJson = []byte(`{ "triggers":[], "source":{ "type":"Dockerfile", - "dockerfile":"FROM docker.io/busybox:latest\nRUN sleep 10m" + "dockerfile":"FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest\nRUN sleep 10m" }, "strategy":{ "type":"Docker", "dockerStrategy":{ "from":{ "kind":"DockerImage", - "name":"docker.io/busybox:latest" + "name":"image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" } } } @@ -21921,14 +21928,14 @@ var _testExtendedTestdataBuildsTestCdsSourcebuildJson = []byte(`{ "triggers": [], "source":{ "type":"Dockerfile", - "dockerfile":"FROM quay.io/fedora/fedora:34-x86_64 \nRUN sleep 10m" + "dockerfile":"FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest\nRUN sleep 10m" }, "strategy": { "type": "Source", "sourceStrategy": { "from": { "kind": "DockerImage", - "name": "quay.io/quay/busybox:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" } } } @@ -22010,7 +22017,7 @@ var _testExtendedTestdataBuildsTestContextBuildJson = []byte(`{ ], "from": { "kind": "DockerImage", - "name": "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" } } }, @@ -22212,14 +22219,14 @@ var _testExtendedTestdataBuildsTestDockerBuildPullsecretJson = []byte(`{ }, "spec": { "source": { - "dockerfile": "FROM quay.io/quay/busybox:latest" + "dockerfile": "FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" }, "strategy": { "type": "Docker", "dockerStrategy": { "from": { "kind": "DockerImage", - "name": "quay.io/quay/busybox:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" } } }, @@ -22242,7 +22249,7 @@ var _testExtendedTestdataBuildsTestDockerBuildPullsecretJson = []byte(`{ }, "spec": { "source": { - "dockerfile": "FROM quay.io/quay/busybox:latest" + "dockerfile": "FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" }, "strategy": { "type": "Docker", @@ -22289,14 +22296,14 @@ var _testExtendedTestdataBuildsTestDockerBuildJson = []byte(`{ "git": { "uri":"https://github.com/sclorg/nodejs-ex" }, - "dockerfile": "FROM docker.io/busybox:latest" + "dockerfile": "FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" }, "strategy":{ "type":"Docker", "dockerStrategy":{ "from":{ "kind":"DockerImage", - "name":"quay.io/quay/busybox:latest" + "name":"image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" } } }, @@ -22352,7 +22359,7 @@ var _testExtendedTestdataBuildsTestDockerNoOutputnameJson = []byte(`{ "triggers": [], "source": { "type": "Git", - "dockerfile": "FROM quay.io/quay/busybox:latest" + "dockerfile": "FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" }, "strategy": { "type": "Docker", @@ -22365,7 +22372,7 @@ var _testExtendedTestdataBuildsTestDockerNoOutputnameJson = []byte(`{ ], "from": { "kind": "DockerImage", - "name": "quay.io/quay/busybox:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" } } } @@ -22406,7 +22413,7 @@ var _testExtendedTestdataBuildsTestEnvBuildJson = []byte(`{ "sourceStrategy":{ "from":{ "kind":"DockerImage", - "name":"registry.redhat.io/rhscl/ruby-25-rhel7:latest" + "name":"image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" } } }, @@ -24930,7 +24937,7 @@ metadata: spec: containers: - name: hello-centos - image: docker.io/centos:centos7 + image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest command: - /bin/sleep - infinity @@ -24942,7 +24949,7 @@ spec: capabilities: {} securityContext: {} - name: hello-centos-2 - image: docker.io/centos:centos7 + image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest command: - /bin/sleep - infinity @@ -30736,9 +30743,9 @@ export KUBECONFIG="${temp_config}" #os::cmd::expect_success 'oc new-project test-project-admin' #os::cmd::try_until_success "oc project test-project-admin" -os::cmd::expect_success 'oc create deploymentconfig --image=openshift/hello-openshift test' -os::cmd::expect_success 'oc run --image=openshift/hello-openshift --restart=Never test3' -os::cmd::expect_success 'oc create job --image=openshift/hello-openshift test4' +os::cmd::expect_success 'oc create deploymentconfig --image=image-registry.openshift-image-registry.svc:5000/openshift/tools:latest test' +os::cmd::expect_success 'oc run --image=image-registry.openshift-image-registry.svc:5000/openshift/tools:latest --restart=Never test3' +os::cmd::expect_success 'oc create job --image=image-registry.openshift-image-registry.svc:5000/openshift/tools:latest test4' os::cmd::expect_success 'oc delete dc/test pod/test3 job/test4' os::cmd::expect_success_and_text 'oc create deploymentconfig --dry-run foo --image=bar -o name' 'deploymentconfig.apps.openshift.io/foo' @@ -31177,9 +31184,9 @@ os::cmd::expect_success 'oc describe deploymentConfigs test-deployment-config' os::cmd::expect_success_and_text 'oc get dc -o name' 'deploymentconfig.apps.openshift.io/test-deployment-config' os::cmd::try_until_success 'oc get rc/test-deployment-config-1' os::cmd::expect_success_and_text 'oc describe dc test-deployment-config' 'deploymentconfig=test-deployment-config' -os::cmd::expect_success_and_text 'oc status' 'dc/test-deployment-config deploys docker.io/openshift/origin-pod:latest' +os::cmd::expect_success_and_text 'oc status' 'dc/test-deployment-config deploys image-registry.openshift-image-registry.svc:5000/openshift/tools:latest' os::cmd::expect_success 'oc create -f ${TEST_DATA}/hello-openshift/hello-pod.json' -os::cmd::try_until_text 'oc status' 'pod/hello-openshift runs openshift/hello-openshift' +os::cmd::try_until_text 'oc status' 'pod/hello-openshift runs' os::test::junit::declare_suite_start "cmd/deployments/env" # Patch a nil list @@ -31279,7 +31286,7 @@ os::cmd::try_until_success 'oc rollout history dc/database --revision=2' # rolling back to the same revision should fail os::cmd::expect_failure 'oc rollback dc/database --to-version=2' # undo --dry-run should report the original image -os::cmd::expect_success_and_text 'oc rollout undo dc/database --dry-run' 'mysql-57-centos7' +os::cmd::expect_success_and_text 'oc rollout undo dc/database --dry-run' 'image-registry.openshift-image-registry.svc:5000/openshift/mysql:5.7' echo "rollback: ok" os::test::junit::declare_suite_end @@ -34578,8 +34585,8 @@ os::cmd::try_until_not_text "oc get projects" "project-bar-2" os::cmd::expect_success "oc new-project project-status --display-name='my project' --description='test project'" # Verify jobs are showing in status -os::cmd::expect_success "oc create job pi --image=perl -- perl -Mbignum=bpi -wle 'print bpi(2000)'" -os::cmd::expect_success_and_text "oc status" "job/pi manages perl" +os::cmd::expect_success "oc create job pi --image=image-registry.openshift-image-registry.svc:5000/openshift/tools:latest -- perl -Mbignum=bpi -wle 'print bpi(2000)'" +os::cmd::expect_success_and_text "oc status" "job/pi manages image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" # logout #os::cmd::expect_success "oc logout" @@ -35230,7 +35237,7 @@ var _testExtendedTestdataCmdTestCmdTestdataApplicationTemplateCustombuildJson = "containers": [ { "name": "ruby-helloworld-database", - "image": "centos/mysql-57-centos7:latest", + "image": "image-registry.openshift-image-registry.svc:5000/openshift/mysql:5.7", "ports": [ { "containerPort": 3306, @@ -35692,7 +35699,7 @@ var _testExtendedTestdataCmdTestCmdTestdataApplicationTemplateDockerbuildJson = "containers": [ { "name": "ruby-helloworld-database", - "image": "centos/mysql-57-centos7:latest", + "image": "image-registry.openshift-image-registry.svc:5000/openshift/mysql:5.7", "ports": [ { "containerPort": 3306, @@ -36199,7 +36206,7 @@ var _testExtendedTestdataCmdTestCmdTestdataApplicationTemplateStibuildJson = []b "containers": [ { "name": "ruby-helloworld-database", - "image": "centos/mysql-57-centos7:latest", + "image": "image-registry.openshift-image-registry.svc:5000/openshift/mysql:5.7", "ports": [ { "containerPort": 3306, @@ -36448,7 +36455,8 @@ var _testExtendedTestdataCmdTestCmdTestdataHelloOpenshiftHelloPodJson = []byte(` "containers": [ { "name": "hello-openshift", - "image": "openshift/hello-openshift", + "image": "k8s.gcr.io/e2e-test-images/agnhost:2.20", + "args": ["netexec"], "ports": [ { "containerPort": 8080, @@ -36517,7 +36525,7 @@ spec: deploymentconfig: idling-echo spec: containers: - - image: openshift/origin-base + - image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest name: idling-tcp-echo command: - /usr/bin/socat @@ -36526,7 +36534,7 @@ spec: ports: - containerPort: 8675 protocol: TCP - - image: openshift/origin-base + - image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest name: idling-udp-echo command: - /usr/bin/socat @@ -38585,7 +38593,7 @@ items: run: v1-job spec: containers: - - image: openshift/hello-openshift + - image: k8s.gcr.io/e2e-test-images/agnhost:2.20 name: hello-container restartPolicy: Never @@ -41018,7 +41026,8 @@ spec: namespaces: [] containers: - name: kubernetes-pause - image: gcr.io/google-containers/pause:2.0 + image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest + command: ["/bin/sleep", "84600"] `) func testExtendedTestdataCmdTestCmdTestdataRollingupdateDaemonsetYamlBytes() ([]byte, error) { @@ -41225,7 +41234,7 @@ items: spec: containers: - name: hello-openshift - image: openshift/hello-openshift + image: k8s.gcr.io/e2e-test-images/agnhost:2.20 - kind: Route apiVersion: v1 metadata: @@ -42016,7 +42025,7 @@ var _testExtendedTestdataCmdTestCmdTestdataTemplatesTemplateTypePrecisionJson = "containers": [ { "name": "test", - "image": "busybox", + "image": "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest", "imagePullPolicy": "IfNotPresent" } ], @@ -42289,7 +42298,7 @@ spec: name: test-deployment spec: containers: - - image: openshift/origin-pod + - image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest imagePullPolicy: IfNotPresent name: ruby-helloworld ports: @@ -42339,14 +42348,14 @@ var _testExtendedTestdataCmdTestCmdTestdataTestDockerBuildJson = []byte(`{ "git": { "uri":"https://github.com/sclorg/nodejs-ex" }, - "dockerfile": "FROM docker.io/busybox:latest" + "dockerfile": "FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" }, "strategy":{ "type":"Docker", "dockerStrategy":{ "from":{ "kind":"DockerImage", - "name":"docker.io/busybox:latest" + "name":"image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" } } }, @@ -42512,7 +42521,7 @@ spec: deploymentconfig: test-deployment spec: containers: - - image: openshift/origin-pod + - image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest imagePullPolicy: IfNotPresent name: ruby-helloworld ports: @@ -42822,7 +42831,7 @@ os::test::junit::declare_suite_end os::test::junit::declare_suite_start "cmd/triggers/deploymentconfigs" ## Deployment configs -os::cmd::expect_success 'oc create deploymentconfig testdc --image=busybox' +os::cmd::expect_success 'oc create deploymentconfig testdc --image=image-registry.openshift-image-registry.svc:5000/openshift/tools:latest' # error conditions os::cmd::expect_failure_and_text 'oc set triggers dc/testdc --from-github' 'deployment configs do not support GitHub web hooks' @@ -42850,7 +42859,7 @@ os::test::junit::declare_suite_end os::test::junit::declare_suite_start "cmd/triggers/annotations" ## Deployment -os::cmd::expect_success 'oc create deployment test --image=busybox' +os::cmd::expect_success 'oc create deployment test --image=image-registry.openshift-image-registry.svc:5000/openshift/tools:latest' # error conditions os::cmd::expect_failure_and_text 'oc set triggers deploy/test --from-github' 'does not support GitHub web hooks' @@ -42858,7 +42867,7 @@ os::cmd::expect_failure_and_text 'oc set triggers deploy/test --from-webhook' 'd os::cmd::expect_failure_and_text 'oc set triggers deploy/test --from-gitlab' 'does not support GitLab web hooks' os::cmd::expect_failure_and_text 'oc set triggers deploy/test --from-bitbucket' 'does not support Bitbucket web hooks' os::cmd::expect_failure_and_text 'oc set triggers deploy/test --from-image=test:latest' 'you must specify --containers when setting --from-image' -os::cmd::expect_failure_and_text 'oc set triggers deploy/test --from-image=test:latest --containers=other' 'not all container names exist: other \(accepts: busybox\)' +os::cmd::expect_failure_and_text 'oc set triggers deploy/test --from-image=test:latest --containers=other' 'not all container names exist: other \(accepts: tools\)' # print os::cmd::expect_success_and_text 'oc set triggers deploy/test' 'config.*true' os::cmd::expect_success_and_not_text 'oc set triggers deploy/test' 'webhook|github|gitlab|bitbucket' @@ -42871,8 +42880,8 @@ os::cmd::expect_success_and_text 'oc set triggers deploy/test' 'config.*false' # auto os::cmd::expect_success_and_text 'oc set triggers deploy/test --auto' 'updated' os::cmd::expect_success_and_text 'oc set triggers deploy/test' 'config.*true' -os::cmd::expect_success_and_text 'oc set triggers deploy/test --from-image=ruby-hello-world:latest -c busybox' 'updated' -os::cmd::expect_success_and_text 'oc set triggers deploy/test' 'image.*ruby-hello-world:latest \(busybox\).*true' +os::cmd::expect_success_and_text 'oc set triggers deploy/test --from-image=ruby-hello-world:latest -c tools' 'updated' +os::cmd::expect_success_and_text 'oc set triggers deploy/test' 'image.*ruby-hello-world:latest \(tools\).*true' os::test::junit::declare_suite_end os::test::junit::declare_suite_end @@ -43063,7 +43072,7 @@ items: jnlp - openshift/jenkins-slave-maven-centos7 + image-registry.openshift-image-registry.svc:5000/openshift/jenkins-agent-maven:latest false false /tmp @@ -43228,7 +43237,7 @@ spec: spec: terminationGracePeriodSeconds: 0 containers: - - image: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + - image: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" imagePullPolicy: IfNotPresent name: myapp command: @@ -43335,7 +43344,7 @@ spec: name: history-limit spec: containers: - - image: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + - image: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" imagePullPolicy: IfNotPresent name: myapp command: @@ -43378,7 +43387,7 @@ spec: spec: terminationGracePeriodSeconds: 0 containers: - - image: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + - image: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" imagePullPolicy: IfNotPresent name: myapp command: @@ -43410,13 +43419,13 @@ spec: - name: pullthrough from: kind: DockerImage - name: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + name: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" referencePolicy: type: Local - name: direct from: kind: DockerImage - name: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + name: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" referencePolicy: type: Source `) @@ -43514,7 +43523,7 @@ spec: spec: terminationGracePeriodSeconds: 0 containers: - - image: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + - image: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" imagePullPolicy: IfNotPresent name: myapp command: @@ -43554,7 +43563,7 @@ spec: name: deployment-simple spec: containers: - - image: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + - image: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" imagePullPolicy: IfNotPresent command: - /bin/sleep @@ -43658,7 +43667,7 @@ spec: name: deployment-simple spec: containers: - - image: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + - image: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" command: [ "/bin/bash", "-c", "sleep infinity" ] imagePullPolicy: IfNotPresent name: myapp @@ -43704,7 +43713,7 @@ spec: name: hook spec: containers: - - image: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + - image: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" command: - /bin/sleep - infinity @@ -43752,7 +43761,7 @@ spec: name: generation-test spec: containers: - - image: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + - image: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" imagePullPolicy: IfNotPresent name: myapp command: @@ -43850,7 +43859,7 @@ spec: name: paused spec: containers: - - image: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + - image: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" imagePullPolicy: IfNotPresent name: myapp command: @@ -43892,7 +43901,7 @@ spec: - command: - /bin/sleep - "infinity" - image: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + image: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" imagePullPolicy: IfNotPresent name: never-ready readinessProbe: @@ -43942,9 +43951,11 @@ spec: labels: name: tag-images spec: + terminationGracePeriodSeconds: 1 containers: - - image: openshift/origin-pod + - image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest imagePullPolicy: IfNotPresent + command: ["/bin/sh", "-c", "sleep 300"] name: sample-name ports: - containerPort: 8080 @@ -43993,7 +44004,7 @@ spec: name: brokendeployment spec: containers: - - image: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + - image: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" imagePullPolicy: IfNotPresent name: myapp command: @@ -44046,7 +44057,7 @@ spec: spec: terminationGracePeriodSeconds: 0 containers: - - image: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + - image: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" imagePullPolicy: IfNotPresent name: myapp command: @@ -46081,7 +46092,7 @@ var _testExtendedTestdataImageTestImageJson = []byte(`{ "name": "test", "creationTimestamp": null }, - "dockerImageReference": "registry.redhat.io/rhscl/ruby-25-rhel7:latest", + "dockerImageReference": "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5", "dockerImageMetadata": { "kind": "DockerImage", "apiVersion": "1.0", @@ -46533,8 +46544,9 @@ metadata: spec: tags: - from: - kind: DockerImage - name: docker.io/openshift/jenkins-slave-maven-centos7:latest + kind: ImageStreamTag + name: jenkins-agent-maven:latest + namespace: openshift name: base - from: kind: ImageStreamTag @@ -46564,8 +46576,9 @@ metadata: spec: tags: - from: - kind: DockerImage - name: quay.io/openshift/origin-jenkins-agent-maven:latest + kind: ImageStreamTag + name: jenkins-agent-maven:latest + namespace: openshift name: base - annotations: role: jenkins-slave @@ -47437,7 +47450,7 @@ var _testExtendedTestdataJenkinsPluginMultitagTemplateJson = []byte(`{ "name": "orig", "from": { "kind": "DockerImage", - "name": "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" } } ] @@ -47455,7 +47468,7 @@ var _testExtendedTestdataJenkinsPluginMultitagTemplateJson = []byte(`{ "name": "orig", "from": { "kind": "DockerImage", - "name": "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" } } ] @@ -47473,7 +47486,7 @@ var _testExtendedTestdataJenkinsPluginMultitagTemplateJson = []byte(`{ "name": "orig", "from": { "kind": "DockerImage", - "name": "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" } } ] @@ -47901,7 +47914,7 @@ spec: spec: containers: - name: simplev1 - image: docker.io/busybox + image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest command: ["/bin/sh", "-c", "exit 0"] restartPolicy: Never `) @@ -48797,7 +48810,7 @@ var _testExtendedTestdataLong_namesFixtureJson = []byte(`{ "sourceStrategy": { "from": { "kind": "DockerImage", - "name": "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" } } } @@ -48826,7 +48839,7 @@ var _testExtendedTestdataLong_namesFixtureJson = []byte(`{ "sourceStrategy": { "from": { "kind": "DockerImage", - "name": "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" } } } @@ -49959,7 +49972,8 @@ items: terminationGracePeriodSeconds: 1 containers: - name: test - image: openshift/hello-openshift + image: k8s.gcr.io/e2e-test-images/agnhost:2.20 + args: ["netexec"] ports: - containerPort: 8080 name: http @@ -49976,7 +49990,8 @@ items: terminationGracePeriodSeconds: 1 containers: - name: test - image: openshift/hello-openshift + image: k8s.gcr.io/e2e-test-images/agnhost:2.20 + args: ["netexec"] ports: - containerPort: 8080 name: http @@ -50010,7 +50025,7 @@ items: app: serving-cert spec: containers: - - image: nginx:1.15.3 + - image: docker.io/library/nginx:1.15-alpine name: serve command: - /usr/sbin/nginx @@ -50208,8 +50223,8 @@ objects: terminationGracePeriodSeconds: 1 containers: - name: test - image: openshift/hello-openshift - # image: openshift/deployment-example:v1 + image: k8s.gcr.io/e2e-test-images/agnhost:2.20 + args: ["netexec"] ports: - containerPort: 8080 name: http @@ -50370,7 +50385,8 @@ objects: terminationGracePeriodSeconds: 1 containers: - name: test - image: openshift/hello-openshift + image: k8s.gcr.io/e2e-test-images/agnhost:2.20 + args: ["netexec"] ports: - containerPort: 8080 name: http @@ -50384,7 +50400,7 @@ objects: app: secure-endpoint spec: containers: - - image: nginx:1.15.3 + - image: docker.io/library/nginx:1.15-alpine name: serve command: - /usr/sbin/nginx @@ -51225,7 +51241,7 @@ items: deploymentconfig: router-http-echo spec: containers: - - image: openshift/origin-node + - image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest name: router-http-echo command: - /usr/bin/socat @@ -51587,7 +51603,8 @@ items: terminationGracePeriodSeconds: 1 containers: - name: test - image: openshift/hello-openshift + image: k8s.gcr.io/e2e-test-images/agnhost:2.20 + args: ["netexec"] ports: - containerPort: 8080 name: http @@ -51604,7 +51621,8 @@ items: terminationGracePeriodSeconds: 1 containers: - name: test - image: openshift/hello-openshift + image: k8s.gcr.io/e2e-test-images/agnhost:2.20 + args: ["netexec"] ports: - containerPort: 8080 name: http @@ -51943,7 +51961,8 @@ objects: terminationGracePeriodSeconds: 1 containers: - name: test - image: openshift/hello-openshift + image: k8s.gcr.io/e2e-test-images/agnhost:2.20 + args: ["netexec"] ports: - containerPort: 8080 name: http @@ -51960,7 +51979,8 @@ objects: terminationGracePeriodSeconds: 1 containers: - name: test - image: openshift/hello-openshift + image: k8s.gcr.io/e2e-test-images/agnhost:2.20 + args: ["netexec"] ports: - containerPort: 8080 name: http @@ -51977,7 +51997,8 @@ objects: terminationGracePeriodSeconds: 1 containers: - name: test - image: openshift/hello-openshift + image: k8s.gcr.io/e2e-test-images/agnhost:2.20 + args: ["netexec"] ports: - containerPort: 8080 name: http @@ -52034,7 +52055,7 @@ var _testExtendedTestdataRun_policyParallelBcYaml = []byte(`--- sourceStrategy: from: kind: "DockerImage" - name: "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + name: "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" resources: {} status: lastVersion: 0 @@ -52081,7 +52102,7 @@ var _testExtendedTestdataRun_policySerialBcYaml = []byte(`--- sourceStrategy: from: kind: "DockerImage" - name: "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + name: "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" - kind: "BuildConfig" apiVersion: "v1" @@ -52102,7 +52123,7 @@ var _testExtendedTestdataRun_policySerialBcYaml = []byte(`--- sourceStrategy: from: kind: "DockerImage" - name: "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + name: "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" `) func testExtendedTestdataRun_policySerialBcYamlBytes() ([]byte, error) { @@ -52145,7 +52166,7 @@ var _testExtendedTestdataRun_policySerialLatestOnlyBcYaml = []byte(`--- sourceStrategy: from: kind: "DockerImage" - name: "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + name: "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" resources: {} status: lastVersion: 0 @@ -53373,7 +53394,7 @@ items: spec: containers: - name: hello-openshift - image: openshift/hello-openshift + image: k8s.gcr.io/e2e-test-images/agnhost:2.20 `) func testExtendedTestdataTemplatesTemplateinstance_badobjectYamlBytes() ([]byte, error) { @@ -53433,7 +53454,7 @@ items: spec: containers: - name: hello-openshift - image: openshift/hello-openshift + image: k8s.gcr.io/e2e-test-images/agnhost:2.20 - kind: Route apiVersion: v1 metadata: @@ -53712,7 +53733,7 @@ items: type: Docker source: type: Git - dockerfile: "FROM busybox:latest\n" + dockerfile: "FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest\n" output: to: kind: ImageStreamTag @@ -53791,7 +53812,7 @@ items: spec: containers: - name: busybox - image: busybox + image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest - kind: DeploymentConfig apiVersion: v1 @@ -53808,7 +53829,7 @@ items: spec: containers: - name: busybox - image: busybox + image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest command: - foo - bar @@ -53857,7 +53878,7 @@ spec: name: test-deployment spec: containers: - - image: openshift/origin-pod + - image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest imagePullPolicy: IfNotPresent name: ruby-helloworld ports: @@ -53905,7 +53926,7 @@ var _testExtendedTestdataTestEnvPodJson = []byte(`{ "containers":[ { "name":"test", - "image":"centos:centos7", + "image":"image-registry.openshift-image-registry.svc:5000/openshift/tools:latest", "env": [ { "name":"podname", @@ -54175,7 +54196,7 @@ spec: deploymentconfig: test-deployment spec: containers: - - image: openshift/origin-pod + - image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest imagePullPolicy: IfNotPresent name: ruby-helloworld ports: @@ -54604,7 +54625,7 @@ var _testIntegrationTestdataTestBuildcliJson = []byte(`{ "sourceStrategy": { "from": { "kind": "DockerImage", - "name": "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" }, "incremental": true } @@ -54646,7 +54667,7 @@ var _testIntegrationTestdataTestBuildcliJson = []byte(`{ "sourceStrategy": { "from": { "kind": "DockerImage", - "name": "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" }, "incremental": true } diff --git a/test/extended/testdata/builds/application-template-custombuild.json b/test/extended/testdata/builds/application-template-custombuild.json index 277a3cf07db4..0dd74be64b1a 100644 --- a/test/extended/testdata/builds/application-template-custombuild.json +++ b/test/extended/testdata/builds/application-template-custombuild.json @@ -401,7 +401,7 @@ "containers": [ { "name": "ruby-helloworld-database", - "image": "centos/mysql-57-centos7:latest", + "image": "image-registry.openshift-image-registry.svc:5000/openshift/mysql:5.7", "ports": [ { "containerPort": 3306, diff --git a/test/extended/testdata/builds/build-postcommit/docker.yaml b/test/extended/testdata/builds/build-postcommit/docker.yaml index 3293bb123fdd..87844a5c1689 100644 --- a/test/extended/testdata/builds/build-postcommit/docker.yaml +++ b/test/extended/testdata/builds/build-postcommit/docker.yaml @@ -13,7 +13,7 @@ items: runPolicy: Serial source: dockerfile: | - FROM busybox:latest + FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest strategy: type: Docker dockerStrategy: diff --git a/test/extended/testdata/builds/build-quota/Dockerfile b/test/extended/testdata/builds/build-quota/Dockerfile index 007a290c65b5..9940d49e1372 100644 --- a/test/extended/testdata/builds/build-quota/Dockerfile +++ b/test/extended/testdata/builds/build-quota/Dockerfile @@ -1,4 +1,4 @@ -FROM centos:7 +FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest USER root ADD .s2i/bin/assemble . diff --git a/test/extended/testdata/builds/build-secrets/Dockerfile b/test/extended/testdata/builds/build-secrets/Dockerfile index 08816510a2dc..d348d7c430d5 100644 --- a/test/extended/testdata/builds/build-secrets/Dockerfile +++ b/test/extended/testdata/builds/build-secrets/Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/busybox +FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest USER root ADD ./secret-dir /secrets diff --git a/test/extended/testdata/builds/build-secrets/test-docker-build.json b/test/extended/testdata/builds/build-secrets/test-docker-build.json index 50a4da01d467..b7f8fe814ec4 100644 --- a/test/extended/testdata/builds/build-secrets/test-docker-build.json +++ b/test/extended/testdata/builds/build-secrets/test-docker-build.json @@ -44,7 +44,7 @@ "dockerStrategy": { "from": { "kind": "DockerImage", - "name": "quay.io/quay/busybox:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" }, "env": [ { diff --git a/test/extended/testdata/builds/build-secrets/test-s2i-build.json b/test/extended/testdata/builds/build-secrets/test-s2i-build.json index 6828378b7fb8..a0fbc03c1f74 100644 --- a/test/extended/testdata/builds/build-secrets/test-s2i-build.json +++ b/test/extended/testdata/builds/build-secrets/test-s2i-build.json @@ -45,7 +45,7 @@ "sourceStrategy": { "from": { "kind": "DockerImage", - "name": "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" }, "env": [ { diff --git a/test/extended/testdata/builds/build-timing/test-docker-build.json b/test/extended/testdata/builds/build-timing/test-docker-build.json index 85346494b3c8..2e926b5436dd 100644 --- a/test/extended/testdata/builds/build-timing/test-docker-build.json +++ b/test/extended/testdata/builds/build-timing/test-docker-build.json @@ -19,7 +19,7 @@ "forcePull": true, "from": { "kind": "DockerImage", - "name": "quay.io/quay/busybox:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" }, "env": [ { diff --git a/test/extended/testdata/builds/custom-build/Dockerfile.sample b/test/extended/testdata/builds/custom-build/Dockerfile.sample index 86e4618f9d84..b4dd5a3a63d3 100644 --- a/test/extended/testdata/builds/custom-build/Dockerfile.sample +++ b/test/extended/testdata/builds/custom-build/Dockerfile.sample @@ -1,2 +1,2 @@ -FROM docker.io/centos:7 +FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest RUN touch /tmp/built diff --git a/test/extended/testdata/builds/custom-build/build.sh b/test/extended/testdata/builds/custom-build/build.sh index 10c9a4428a1d..9762ed8d3d36 100644 --- a/test/extended/testdata/builds/custom-build/build.sh +++ b/test/extended/testdata/builds/custom-build/build.sh @@ -1,15 +1,22 @@ #!/bin/sh + +set -euo pipefail + # Note that in this case the build inputs are part of the custom builder image, but normally this # would be retrieved from an external source. cd /tmp/input # OUTPUT_REGISTRY and OUTPUT_IMAGE are env variables provided by the custom # build framework TAG="${OUTPUT_REGISTRY}/${OUTPUT_IMAGE}" -# performs the build of the new image defined by Dockerfile.sample -buildah --storage-driver vfs bud --isolation chroot -t ${TAG} . + +cp -R /var/run/configs/openshift.io/certs/certs.d/* /etc/containers/certs.d/ + # buildah requires a slight modification to the push secret provided by the service account in order to use it for pushing the image -cp /var/run/secrets/openshift.io/push/.dockercfg /tmp -(echo "{ \"auths\": " ; cat /var/run/secrets/openshift.io/push/.dockercfg ; echo "}") > /tmp/.dockercfg +echo "{ \"auths\": $(cat /var/run/secrets/openshift.io/pull/.dockercfg)}" > /tmp/.pull +echo "{ \"auths\": $(cat /var/run/secrets/openshift.io/push/.dockercfg)}" > /tmp/.push + +# performs the build of the new image defined by Dockerfile.sample +buildah --authfile /tmp/.pull --storage-driver vfs bud --isolation chroot -t ${TAG} . # push the new image to the target for the build -buildah --storage-driver vfs push --tls-verify=false --authfile /tmp/.dockercfg ${TAG} +buildah --authfile /tmp/.push --storage-driver vfs push ${TAG} diff --git a/test/extended/testdata/builds/docker-add/Dockerfile b/test/extended/testdata/builds/docker-add/Dockerfile index b5b4e2333875..b130e60e3cc0 100644 --- a/test/extended/testdata/builds/docker-add/Dockerfile +++ b/test/extended/testdata/builds/docker-add/Dockerfile @@ -1,2 +1,2 @@ -FROM centos:7 +FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest ADD no-exist-file . diff --git a/test/extended/testdata/builds/incremental-auth-build.json b/test/extended/testdata/builds/incremental-auth-build.json index d97ea90ec035..06a28023a88c 100644 --- a/test/extended/testdata/builds/incremental-auth-build.json +++ b/test/extended/testdata/builds/incremental-auth-build.json @@ -48,7 +48,7 @@ ], "from": { "kind": "DockerImage", - "name": "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" }, "incremental": true } diff --git a/test/extended/testdata/builds/pullsecret/linked-nodejs-bc.yaml b/test/extended/testdata/builds/pullsecret/linked-nodejs-bc.yaml index 64ed5e436007..9fb1d08331f5 100644 --- a/test/extended/testdata/builds/pullsecret/linked-nodejs-bc.yaml +++ b/test/extended/testdata/builds/pullsecret/linked-nodejs-bc.yaml @@ -11,4 +11,4 @@ spec: sourceStrategy: from: kind: DockerImage - name: registry.redhat.io/rhscl/nodejs-10-rhel7:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/nodejs:10 diff --git a/test/extended/testdata/builds/statusfail-badcontextdirs2i.yaml b/test/extended/testdata/builds/statusfail-badcontextdirs2i.yaml index b05936abe0d7..bb079b815990 100644 --- a/test/extended/testdata/builds/statusfail-badcontextdirs2i.yaml +++ b/test/extended/testdata/builds/statusfail-badcontextdirs2i.yaml @@ -12,4 +12,4 @@ spec: sourceStrategy: from: kind: DockerImage - name: registry.redhat.io/rhscl/ruby-25-rhel7:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5 diff --git a/test/extended/testdata/builds/statusfail-fetchimagecontentdocker.yaml b/test/extended/testdata/builds/statusfail-fetchimagecontentdocker.yaml index 4c5f5919b6e7..8ca2dd421744 100644 --- a/test/extended/testdata/builds/statusfail-fetchimagecontentdocker.yaml +++ b/test/extended/testdata/builds/statusfail-fetchimagecontentdocker.yaml @@ -19,4 +19,4 @@ spec: dockerStrategy: from: kind: DockerImage - name: registry.redhat.io/rhscl/ruby-25-rhel7:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5 diff --git a/test/extended/testdata/builds/statusfail-fetchsourcedocker.yaml b/test/extended/testdata/builds/statusfail-fetchsourcedocker.yaml index 144d076912b4..931fa1425574 100644 --- a/test/extended/testdata/builds/statusfail-fetchsourcedocker.yaml +++ b/test/extended/testdata/builds/statusfail-fetchsourcedocker.yaml @@ -11,4 +11,4 @@ spec: dockerStrategy: from: kind: DockerImage - name: registry.redhat.io/rhscl/ruby-25-rhel7:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5 diff --git a/test/extended/testdata/builds/statusfail-fetchsources2i.yaml b/test/extended/testdata/builds/statusfail-fetchsources2i.yaml index d65f1e8ed605..1b377a4d7046 100644 --- a/test/extended/testdata/builds/statusfail-fetchsources2i.yaml +++ b/test/extended/testdata/builds/statusfail-fetchsources2i.yaml @@ -11,4 +11,4 @@ spec: sourceStrategy: from: kind: DockerImage - name: registry.redhat.io/rhscl/ruby-25-rhel7:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5 diff --git a/test/extended/testdata/builds/statusfail-genericreason.yaml b/test/extended/testdata/builds/statusfail-genericreason.yaml index 8142cd89eea7..ff611a2c58f0 100644 --- a/test/extended/testdata/builds/statusfail-genericreason.yaml +++ b/test/extended/testdata/builds/statusfail-genericreason.yaml @@ -11,7 +11,7 @@ spec: sourceStrategy: from: kind: DockerImage - name: registry.redhat.io/rhscl/ruby-25-rhel7:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5 scripts: "http://example.org/scripts" env: - name: http_proxy diff --git a/test/extended/testdata/builds/statusfail-oomkilled.yaml b/test/extended/testdata/builds/statusfail-oomkilled.yaml index ff557d38ac45..1205d8106a69 100644 --- a/test/extended/testdata/builds/statusfail-oomkilled.yaml +++ b/test/extended/testdata/builds/statusfail-oomkilled.yaml @@ -14,5 +14,5 @@ spec: sourceStrategy: from: kind: DockerImage - name: registry.redhat.io/rhscl/ruby-25-rhel7:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5 forcePull: true diff --git a/test/extended/testdata/builds/test-build-proxy.yaml b/test/extended/testdata/builds/test-build-proxy.yaml index b8455d0ce5ac..7730df98868a 100644 --- a/test/extended/testdata/builds/test-build-proxy.yaml +++ b/test/extended/testdata/builds/test-build-proxy.yaml @@ -84,7 +84,7 @@ items: dockerStrategy: from: kind: DockerImage - name: registry.redhat.io/rhscl/ruby-25-rhel7:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5 env: - name: SOME_HTTP_PROXY value: https://envuser:password@proxy3.com diff --git a/test/extended/testdata/builds/test-build.yaml b/test/extended/testdata/builds/test-build.yaml index a3e9a8a97d3d..a8c1e1c175e2 100644 --- a/test/extended/testdata/builds/test-build.yaml +++ b/test/extended/testdata/builds/test-build.yaml @@ -48,7 +48,7 @@ items: value: '5' from: kind: DockerImage - name: registry.redhat.io/rhscl/ruby-25-rhel7:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5 resources: {} status: lastVersion: 0 @@ -77,7 +77,7 @@ items: value: '5' from: kind: DockerImage - name: registry.redhat.io/rhscl/ruby-25-rhel7:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5 resources: {} status: lastVersion: 0 @@ -105,7 +105,7 @@ items: value: '5' from: kind: DockerImage - name: registry.redhat.io/rhscl/ruby-25-rhel7:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5 resources: {} status: lastVersion: 0 @@ -134,7 +134,7 @@ items: value: '5' from: kind: DockerImage - name: registry.redhat.io/rhscl/ruby-25-rhel7:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5 resources: {} status: lastVersion: 0 @@ -162,7 +162,7 @@ items: value: '5' from: kind: DockerImage - name: registry.redhat.io/rhscl/ruby-25-rhel7:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5 resources: {} nodeSelector: nodelabelkey: nodelabelvalue @@ -188,7 +188,7 @@ items: dockerStrategy: from: kind: DockerImage - name: quay.io/quay/busybox:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest resources: {} postCommit: {} nodeSelector: @@ -214,7 +214,7 @@ items: dockerStrategy: from: kind: DockerImage - name: quay.io/quay/busybox:latest + name: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest buildArgs: - name: foofoo value: default diff --git a/test/extended/testdata/builds/test-cds-dockerbuild.json b/test/extended/testdata/builds/test-cds-dockerbuild.json index a669cc963f99..e1ed5442970a 100644 --- a/test/extended/testdata/builds/test-cds-dockerbuild.json +++ b/test/extended/testdata/builds/test-cds-dockerbuild.json @@ -9,14 +9,14 @@ "triggers":[], "source":{ "type":"Dockerfile", - "dockerfile":"FROM docker.io/busybox:latest\nRUN sleep 10m" + "dockerfile":"FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest\nRUN sleep 10m" }, "strategy":{ "type":"Docker", "dockerStrategy":{ "from":{ "kind":"DockerImage", - "name":"docker.io/busybox:latest" + "name":"image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" } } } diff --git a/test/extended/testdata/builds/test-cds-sourcebuild.json b/test/extended/testdata/builds/test-cds-sourcebuild.json index 42fd658fcb26..13ca8d9bdb9e 100644 --- a/test/extended/testdata/builds/test-cds-sourcebuild.json +++ b/test/extended/testdata/builds/test-cds-sourcebuild.json @@ -25,14 +25,14 @@ "triggers": [], "source":{ "type":"Dockerfile", - "dockerfile":"FROM quay.io/fedora/fedora:34-x86_64 \nRUN sleep 10m" + "dockerfile":"FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest\nRUN sleep 10m" }, "strategy": { "type": "Source", "sourceStrategy": { "from": { "kind": "DockerImage", - "name": "quay.io/quay/busybox:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" } } } diff --git a/test/extended/testdata/builds/test-context-build.json b/test/extended/testdata/builds/test-context-build.json index 5daff97267ea..09311eb239ae 100644 --- a/test/extended/testdata/builds/test-context-build.json +++ b/test/extended/testdata/builds/test-context-build.json @@ -55,7 +55,7 @@ ], "from": { "kind": "DockerImage", - "name": "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" } } }, diff --git a/test/extended/testdata/builds/test-docker-build-pullsecret.json b/test/extended/testdata/builds/test-docker-build-pullsecret.json index 4e93da9fda4e..4b058d88b1dc 100644 --- a/test/extended/testdata/builds/test-docker-build-pullsecret.json +++ b/test/extended/testdata/builds/test-docker-build-pullsecret.json @@ -25,14 +25,14 @@ }, "spec": { "source": { - "dockerfile": "FROM quay.io/quay/busybox:latest" + "dockerfile": "FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" }, "strategy": { "type": "Docker", "dockerStrategy": { "from": { "kind": "DockerImage", - "name": "quay.io/quay/busybox:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" } } }, @@ -55,7 +55,7 @@ }, "spec": { "source": { - "dockerfile": "FROM quay.io/quay/busybox:latest" + "dockerfile": "FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" }, "strategy": { "type": "Docker", diff --git a/test/extended/testdata/builds/test-docker-build.json b/test/extended/testdata/builds/test-docker-build.json index ace2b68395a4..d2547d169c05 100644 --- a/test/extended/testdata/builds/test-docker-build.json +++ b/test/extended/testdata/builds/test-docker-build.json @@ -13,14 +13,14 @@ "git": { "uri":"https://github.com/sclorg/nodejs-ex" }, - "dockerfile": "FROM docker.io/busybox:latest" + "dockerfile": "FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" }, "strategy":{ "type":"Docker", "dockerStrategy":{ "from":{ "kind":"DockerImage", - "name":"quay.io/quay/busybox:latest" + "name":"image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" } } }, diff --git a/test/extended/testdata/builds/test-docker-no-outputname.json b/test/extended/testdata/builds/test-docker-no-outputname.json index 9109e270d8b9..8b2e744fc561 100644 --- a/test/extended/testdata/builds/test-docker-no-outputname.json +++ b/test/extended/testdata/builds/test-docker-no-outputname.json @@ -11,7 +11,7 @@ "triggers": [], "source": { "type": "Git", - "dockerfile": "FROM quay.io/quay/busybox:latest" + "dockerfile": "FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" }, "strategy": { "type": "Docker", @@ -24,7 +24,7 @@ ], "from": { "kind": "DockerImage", - "name": "quay.io/quay/busybox:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" } } } diff --git a/test/extended/testdata/builds/test-env-build.json b/test/extended/testdata/builds/test-env-build.json index 8c2f309447ac..66305ae54851 100644 --- a/test/extended/testdata/builds/test-env-build.json +++ b/test/extended/testdata/builds/test-env-build.json @@ -17,7 +17,7 @@ "sourceStrategy":{ "from":{ "kind":"DockerImage", - "name":"registry.redhat.io/rhscl/ruby-25-rhel7:latest" + "name":"image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" } } }, diff --git a/test/extended/testdata/cli/pod-with-two-containers.yaml b/test/extended/testdata/cli/pod-with-two-containers.yaml index 2f87ed72a0da..2f39637e0c4b 100644 --- a/test/extended/testdata/cli/pod-with-two-containers.yaml +++ b/test/extended/testdata/cli/pod-with-two-containers.yaml @@ -7,7 +7,7 @@ metadata: spec: containers: - name: hello-centos - image: docker.io/centos:centos7 + image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest command: - /bin/sleep - infinity @@ -19,7 +19,7 @@ spec: capabilities: {} securityContext: {} - name: hello-centos-2 - image: docker.io/centos:centos7 + image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest command: - /bin/sleep - infinity diff --git a/test/extended/testdata/cmd/test/cmd/basicresources.sh b/test/extended/testdata/cmd/test/cmd/basicresources.sh index adef7c860cbc..5284c03c4b86 100755 --- a/test/extended/testdata/cmd/test/cmd/basicresources.sh +++ b/test/extended/testdata/cmd/test/cmd/basicresources.sh @@ -278,9 +278,9 @@ export KUBECONFIG="${temp_config}" #os::cmd::expect_success 'oc new-project test-project-admin' #os::cmd::try_until_success "oc project test-project-admin" -os::cmd::expect_success 'oc create deploymentconfig --image=openshift/hello-openshift test' -os::cmd::expect_success 'oc run --image=openshift/hello-openshift --restart=Never test3' -os::cmd::expect_success 'oc create job --image=openshift/hello-openshift test4' +os::cmd::expect_success 'oc create deploymentconfig --image=image-registry.openshift-image-registry.svc:5000/openshift/tools:latest test' +os::cmd::expect_success 'oc run --image=image-registry.openshift-image-registry.svc:5000/openshift/tools:latest --restart=Never test3' +os::cmd::expect_success 'oc create job --image=image-registry.openshift-image-registry.svc:5000/openshift/tools:latest test4' os::cmd::expect_success 'oc delete dc/test pod/test3 job/test4' os::cmd::expect_success_and_text 'oc create deploymentconfig --dry-run foo --image=bar -o name' 'deploymentconfig.apps.openshift.io/foo' diff --git a/test/extended/testdata/cmd/test/cmd/deployments.sh b/test/extended/testdata/cmd/test/cmd/deployments.sh index 0ae3c0aace45..c1f77be513eb 100755 --- a/test/extended/testdata/cmd/test/cmd/deployments.sh +++ b/test/extended/testdata/cmd/test/cmd/deployments.sh @@ -20,9 +20,9 @@ os::cmd::expect_success 'oc describe deploymentConfigs test-deployment-config' os::cmd::expect_success_and_text 'oc get dc -o name' 'deploymentconfig.apps.openshift.io/test-deployment-config' os::cmd::try_until_success 'oc get rc/test-deployment-config-1' os::cmd::expect_success_and_text 'oc describe dc test-deployment-config' 'deploymentconfig=test-deployment-config' -os::cmd::expect_success_and_text 'oc status' 'dc/test-deployment-config deploys docker.io/openshift/origin-pod:latest' +os::cmd::expect_success_and_text 'oc status' 'dc/test-deployment-config deploys image-registry.openshift-image-registry.svc:5000/openshift/tools:latest' os::cmd::expect_success 'oc create -f ${TEST_DATA}/hello-openshift/hello-pod.json' -os::cmd::try_until_text 'oc status' 'pod/hello-openshift runs openshift/hello-openshift' +os::cmd::try_until_text 'oc status' 'pod/hello-openshift runs' os::test::junit::declare_suite_start "cmd/deployments/env" # Patch a nil list @@ -122,7 +122,7 @@ os::cmd::try_until_success 'oc rollout history dc/database --revision=2' # rolling back to the same revision should fail os::cmd::expect_failure 'oc rollback dc/database --to-version=2' # undo --dry-run should report the original image -os::cmd::expect_success_and_text 'oc rollout undo dc/database --dry-run' 'mysql-57-centos7' +os::cmd::expect_success_and_text 'oc rollout undo dc/database --dry-run' 'image-registry.openshift-image-registry.svc:5000/openshift/mysql:5.7' echo "rollback: ok" os::test::junit::declare_suite_end diff --git a/test/extended/testdata/cmd/test/cmd/status.sh b/test/extended/testdata/cmd/test/cmd/status.sh index e4697451c31c..44ff65c4ae47 100755 --- a/test/extended/testdata/cmd/test/cmd/status.sh +++ b/test/extended/testdata/cmd/test/cmd/status.sh @@ -81,8 +81,8 @@ os::cmd::try_until_not_text "oc get projects" "project-bar-2" os::cmd::expect_success "oc new-project project-status --display-name='my project' --description='test project'" # Verify jobs are showing in status -os::cmd::expect_success "oc create job pi --image=perl -- perl -Mbignum=bpi -wle 'print bpi(2000)'" -os::cmd::expect_success_and_text "oc status" "job/pi manages perl" +os::cmd::expect_success "oc create job pi --image=image-registry.openshift-image-registry.svc:5000/openshift/tools:latest -- perl -Mbignum=bpi -wle 'print bpi(2000)'" +os::cmd::expect_success_and_text "oc status" "job/pi manages image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" # logout #os::cmd::expect_success "oc logout" diff --git a/test/extended/testdata/cmd/test/cmd/testdata/application-template-custombuild.json b/test/extended/testdata/cmd/test/cmd/testdata/application-template-custombuild.json index 277a3cf07db4..0dd74be64b1a 100644 --- a/test/extended/testdata/cmd/test/cmd/testdata/application-template-custombuild.json +++ b/test/extended/testdata/cmd/test/cmd/testdata/application-template-custombuild.json @@ -401,7 +401,7 @@ "containers": [ { "name": "ruby-helloworld-database", - "image": "centos/mysql-57-centos7:latest", + "image": "image-registry.openshift-image-registry.svc:5000/openshift/mysql:5.7", "ports": [ { "containerPort": 3306, diff --git a/test/extended/testdata/cmd/test/cmd/testdata/application-template-dockerbuild.json b/test/extended/testdata/cmd/test/cmd/testdata/application-template-dockerbuild.json index eac61080c6bd..9574293c7870 100644 --- a/test/extended/testdata/cmd/test/cmd/testdata/application-template-dockerbuild.json +++ b/test/extended/testdata/cmd/test/cmd/testdata/application-template-dockerbuild.json @@ -355,7 +355,7 @@ "containers": [ { "name": "ruby-helloworld-database", - "image": "centos/mysql-57-centos7:latest", + "image": "image-registry.openshift-image-registry.svc:5000/openshift/mysql:5.7", "ports": [ { "containerPort": 3306, diff --git a/test/extended/testdata/cmd/test/cmd/testdata/application-template-stibuild.json b/test/extended/testdata/cmd/test/cmd/testdata/application-template-stibuild.json index 50b12f109460..b6eeefd042e4 100644 --- a/test/extended/testdata/cmd/test/cmd/testdata/application-template-stibuild.json +++ b/test/extended/testdata/cmd/test/cmd/testdata/application-template-stibuild.json @@ -400,7 +400,7 @@ "containers": [ { "name": "ruby-helloworld-database", - "image": "centos/mysql-57-centos7:latest", + "image": "image-registry.openshift-image-registry.svc:5000/openshift/mysql:5.7", "ports": [ { "containerPort": 3306, diff --git a/test/extended/testdata/cmd/test/cmd/testdata/hello-openshift/hello-pod.json b/test/extended/testdata/cmd/test/cmd/testdata/hello-openshift/hello-pod.json index ad40533746c7..98c9027fefec 100644 --- a/test/extended/testdata/cmd/test/cmd/testdata/hello-openshift/hello-pod.json +++ b/test/extended/testdata/cmd/test/cmd/testdata/hello-openshift/hello-pod.json @@ -12,7 +12,8 @@ "containers": [ { "name": "hello-openshift", - "image": "openshift/hello-openshift", + "image": "k8s.gcr.io/e2e-test-images/agnhost:2.20", + "args": ["netexec"], "ports": [ { "containerPort": 8080, diff --git a/test/extended/testdata/cmd/test/cmd/testdata/idling-dc.yaml b/test/extended/testdata/cmd/test/cmd/testdata/idling-dc.yaml index 1143cef9b00f..2acaa47622fc 100644 --- a/test/extended/testdata/cmd/test/cmd/testdata/idling-dc.yaml +++ b/test/extended/testdata/cmd/test/cmd/testdata/idling-dc.yaml @@ -16,7 +16,7 @@ spec: deploymentconfig: idling-echo spec: containers: - - image: openshift/origin-base + - image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest name: idling-tcp-echo command: - /usr/bin/socat @@ -25,7 +25,7 @@ spec: ports: - containerPort: 8675 protocol: TCP - - image: openshift/origin-base + - image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest name: idling-udp-echo command: - /usr/bin/socat diff --git a/test/extended/testdata/cmd/test/cmd/testdata/mixed-api-versions.yaml b/test/extended/testdata/cmd/test/cmd/testdata/mixed-api-versions.yaml index 009f88cd198d..5e4a6015db56 100644 --- a/test/extended/testdata/cmd/test/cmd/testdata/mixed-api-versions.yaml +++ b/test/extended/testdata/cmd/test/cmd/testdata/mixed-api-versions.yaml @@ -34,7 +34,7 @@ items: run: v1-job spec: containers: - - image: openshift/hello-openshift + - image: k8s.gcr.io/e2e-test-images/agnhost:2.20 name: hello-container restartPolicy: Never diff --git a/test/extended/testdata/cmd/test/cmd/testdata/rollingupdate-daemonset.yaml b/test/extended/testdata/cmd/test/cmd/testdata/rollingupdate-daemonset.yaml index 8c52ee91a06a..56ab65ac3b2e 100644 --- a/test/extended/testdata/cmd/test/cmd/testdata/rollingupdate-daemonset.yaml +++ b/test/extended/testdata/cmd/test/cmd/testdata/rollingupdate-daemonset.yaml @@ -27,4 +27,5 @@ spec: namespaces: [] containers: - name: kubernetes-pause - image: gcr.io/google-containers/pause:2.0 + image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest + command: ["/bin/sleep", "84600"] diff --git a/test/extended/testdata/cmd/test/cmd/testdata/templateinstance_objectkinds.yaml b/test/extended/testdata/cmd/test/cmd/testdata/templateinstance_objectkinds.yaml index e96055807fca..9db1c8294e14 100644 --- a/test/extended/testdata/cmd/test/cmd/testdata/templateinstance_objectkinds.yaml +++ b/test/extended/testdata/cmd/test/cmd/testdata/templateinstance_objectkinds.yaml @@ -40,7 +40,7 @@ items: spec: containers: - name: hello-openshift - image: openshift/hello-openshift + image: k8s.gcr.io/e2e-test-images/agnhost:2.20 - kind: Route apiVersion: v1 metadata: diff --git a/test/extended/testdata/cmd/test/cmd/testdata/templates/template-type-precision.json b/test/extended/testdata/cmd/test/cmd/testdata/templates/template-type-precision.json index 119f24713cad..ae370b474a47 100644 --- a/test/extended/testdata/cmd/test/cmd/testdata/templates/template-type-precision.json +++ b/test/extended/testdata/cmd/test/cmd/testdata/templates/template-type-precision.json @@ -18,7 +18,7 @@ "containers": [ { "name": "test", - "image": "busybox", + "image": "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest", "imagePullPolicy": "IfNotPresent" } ], diff --git a/test/extended/testdata/cmd/test/cmd/testdata/test-deployment-config.yaml b/test/extended/testdata/cmd/test/cmd/testdata/test-deployment-config.yaml index ce3436dc507b..6f46ae18eba6 100644 --- a/test/extended/testdata/cmd/test/cmd/testdata/test-deployment-config.yaml +++ b/test/extended/testdata/cmd/test/cmd/testdata/test-deployment-config.yaml @@ -23,7 +23,7 @@ spec: name: test-deployment spec: containers: - - image: openshift/origin-pod + - image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest imagePullPolicy: IfNotPresent name: ruby-helloworld ports: diff --git a/test/extended/testdata/cmd/test/cmd/testdata/test-docker-build.json b/test/extended/testdata/cmd/test/cmd/testdata/test-docker-build.json index e0ff3f0cf495..d2547d169c05 100644 --- a/test/extended/testdata/cmd/test/cmd/testdata/test-docker-build.json +++ b/test/extended/testdata/cmd/test/cmd/testdata/test-docker-build.json @@ -13,14 +13,14 @@ "git": { "uri":"https://github.com/sclorg/nodejs-ex" }, - "dockerfile": "FROM docker.io/busybox:latest" + "dockerfile": "FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" }, "strategy":{ "type":"Docker", "dockerStrategy":{ "from":{ "kind":"DockerImage", - "name":"docker.io/busybox:latest" + "name":"image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" } } }, diff --git a/test/extended/testdata/cmd/test/cmd/testdata/test-replication-controller.yaml b/test/extended/testdata/cmd/test/cmd/testdata/test-replication-controller.yaml index 4172877ce01d..fe5da07f9374 100644 --- a/test/extended/testdata/cmd/test/cmd/testdata/test-replication-controller.yaml +++ b/test/extended/testdata/cmd/test/cmd/testdata/test-replication-controller.yaml @@ -19,7 +19,7 @@ spec: deploymentconfig: test-deployment spec: containers: - - image: openshift/origin-pod + - image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest imagePullPolicy: IfNotPresent name: ruby-helloworld ports: diff --git a/test/extended/testdata/cmd/test/cmd/triggers.sh b/test/extended/testdata/cmd/test/cmd/triggers.sh index a8b248fde803..0c6f67812cc5 100755 --- a/test/extended/testdata/cmd/test/cmd/triggers.sh +++ b/test/extended/testdata/cmd/test/cmd/triggers.sh @@ -93,7 +93,7 @@ os::test::junit::declare_suite_end os::test::junit::declare_suite_start "cmd/triggers/deploymentconfigs" ## Deployment configs -os::cmd::expect_success 'oc create deploymentconfig testdc --image=busybox' +os::cmd::expect_success 'oc create deploymentconfig testdc --image=image-registry.openshift-image-registry.svc:5000/openshift/tools:latest' # error conditions os::cmd::expect_failure_and_text 'oc set triggers dc/testdc --from-github' 'deployment configs do not support GitHub web hooks' @@ -121,7 +121,7 @@ os::test::junit::declare_suite_end os::test::junit::declare_suite_start "cmd/triggers/annotations" ## Deployment -os::cmd::expect_success 'oc create deployment test --image=busybox' +os::cmd::expect_success 'oc create deployment test --image=image-registry.openshift-image-registry.svc:5000/openshift/tools:latest' # error conditions os::cmd::expect_failure_and_text 'oc set triggers deploy/test --from-github' 'does not support GitHub web hooks' @@ -129,7 +129,7 @@ os::cmd::expect_failure_and_text 'oc set triggers deploy/test --from-webhook' 'd os::cmd::expect_failure_and_text 'oc set triggers deploy/test --from-gitlab' 'does not support GitLab web hooks' os::cmd::expect_failure_and_text 'oc set triggers deploy/test --from-bitbucket' 'does not support Bitbucket web hooks' os::cmd::expect_failure_and_text 'oc set triggers deploy/test --from-image=test:latest' 'you must specify --containers when setting --from-image' -os::cmd::expect_failure_and_text 'oc set triggers deploy/test --from-image=test:latest --containers=other' 'not all container names exist: other \(accepts: busybox\)' +os::cmd::expect_failure_and_text 'oc set triggers deploy/test --from-image=test:latest --containers=other' 'not all container names exist: other \(accepts: tools\)' # print os::cmd::expect_success_and_text 'oc set triggers deploy/test' 'config.*true' os::cmd::expect_success_and_not_text 'oc set triggers deploy/test' 'webhook|github|gitlab|bitbucket' @@ -142,8 +142,8 @@ os::cmd::expect_success_and_text 'oc set triggers deploy/test' 'config.*false' # auto os::cmd::expect_success_and_text 'oc set triggers deploy/test --auto' 'updated' os::cmd::expect_success_and_text 'oc set triggers deploy/test' 'config.*true' -os::cmd::expect_success_and_text 'oc set triggers deploy/test --from-image=ruby-hello-world:latest -c busybox' 'updated' -os::cmd::expect_success_and_text 'oc set triggers deploy/test' 'image.*ruby-hello-world:latest \(busybox\).*true' +os::cmd::expect_success_and_text 'oc set triggers deploy/test --from-image=ruby-hello-world:latest -c tools' 'updated' +os::cmd::expect_success_and_text 'oc set triggers deploy/test' 'image.*ruby-hello-world:latest \(tools\).*true' os::test::junit::declare_suite_end os::test::junit::declare_suite_end diff --git a/test/extended/testdata/config-map-jenkins-slave-pods.yaml b/test/extended/testdata/config-map-jenkins-slave-pods.yaml index ea4799cc30c5..85c4ead709dc 100644 --- a/test/extended/testdata/config-map-jenkins-slave-pods.yaml +++ b/test/extended/testdata/config-map-jenkins-slave-pods.yaml @@ -15,7 +15,7 @@ items: jnlp - openshift/jenkins-slave-maven-centos7 + image-registry.openshift-image-registry.svc:5000/openshift/jenkins-agent-maven:latest false false /tmp diff --git a/test/extended/testdata/deployments/custom-deployment.yaml b/test/extended/testdata/deployments/custom-deployment.yaml index 999675940875..d8397116d361 100644 --- a/test/extended/testdata/deployments/custom-deployment.yaml +++ b/test/extended/testdata/deployments/custom-deployment.yaml @@ -36,7 +36,7 @@ spec: spec: terminationGracePeriodSeconds: 0 containers: - - image: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + - image: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" imagePullPolicy: IfNotPresent name: myapp command: diff --git a/test/extended/testdata/deployments/deployment-history-limit.yaml b/test/extended/testdata/deployments/deployment-history-limit.yaml index 6aa01f629901..229eb91f269c 100644 --- a/test/extended/testdata/deployments/deployment-history-limit.yaml +++ b/test/extended/testdata/deployments/deployment-history-limit.yaml @@ -12,7 +12,7 @@ spec: name: history-limit spec: containers: - - image: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + - image: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" imagePullPolicy: IfNotPresent name: myapp command: diff --git a/test/extended/testdata/deployments/deployment-ignores-deployer.yaml b/test/extended/testdata/deployments/deployment-ignores-deployer.yaml index adc35c7fb6d4..d7c0e7a3bd65 100644 --- a/test/extended/testdata/deployments/deployment-ignores-deployer.yaml +++ b/test/extended/testdata/deployments/deployment-ignores-deployer.yaml @@ -15,7 +15,7 @@ spec: spec: terminationGracePeriodSeconds: 0 containers: - - image: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + - image: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" imagePullPolicy: IfNotPresent name: myapp command: diff --git a/test/extended/testdata/deployments/deployment-image-resolution-is.yaml b/test/extended/testdata/deployments/deployment-image-resolution-is.yaml index 5b9aec8d94fd..9fdeebffcab6 100644 --- a/test/extended/testdata/deployments/deployment-image-resolution-is.yaml +++ b/test/extended/testdata/deployments/deployment-image-resolution-is.yaml @@ -7,12 +7,12 @@ spec: - name: pullthrough from: kind: DockerImage - name: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + name: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" referencePolicy: type: Local - name: direct from: kind: DockerImage - name: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + name: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" referencePolicy: type: Source diff --git a/test/extended/testdata/deployments/deployment-min-ready-seconds.yaml b/test/extended/testdata/deployments/deployment-min-ready-seconds.yaml index 82ef3fad4ff0..cbdbe16932d9 100644 --- a/test/extended/testdata/deployments/deployment-min-ready-seconds.yaml +++ b/test/extended/testdata/deployments/deployment-min-ready-seconds.yaml @@ -14,7 +14,7 @@ spec: spec: terminationGracePeriodSeconds: 0 containers: - - image: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + - image: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" imagePullPolicy: IfNotPresent name: myapp command: diff --git a/test/extended/testdata/deployments/deployment-simple.yaml b/test/extended/testdata/deployments/deployment-simple.yaml index 653c05eb09d0..e3259b5e1494 100644 --- a/test/extended/testdata/deployments/deployment-simple.yaml +++ b/test/extended/testdata/deployments/deployment-simple.yaml @@ -15,7 +15,7 @@ spec: name: deployment-simple spec: containers: - - image: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + - image: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" imagePullPolicy: IfNotPresent command: - /bin/sleep diff --git a/test/extended/testdata/deployments/deployment-with-ref-env.yaml b/test/extended/testdata/deployments/deployment-with-ref-env.yaml index 8bba633a98e2..64485cedc277 100644 --- a/test/extended/testdata/deployments/deployment-with-ref-env.yaml +++ b/test/extended/testdata/deployments/deployment-with-ref-env.yaml @@ -27,7 +27,7 @@ spec: name: deployment-simple spec: containers: - - image: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + - image: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" command: [ "/bin/bash", "-c", "sleep infinity" ] imagePullPolicy: IfNotPresent name: myapp diff --git a/test/extended/testdata/deployments/failing-pre-hook.yaml b/test/extended/testdata/deployments/failing-pre-hook.yaml index a03973336479..cfe1eb83b350 100644 --- a/test/extended/testdata/deployments/failing-pre-hook.yaml +++ b/test/extended/testdata/deployments/failing-pre-hook.yaml @@ -23,7 +23,7 @@ spec: name: hook spec: containers: - - image: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + - image: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" command: - /bin/sleep - infinity diff --git a/test/extended/testdata/deployments/generation-test.yaml b/test/extended/testdata/deployments/generation-test.yaml index dc7301893656..dbe1779a3e85 100644 --- a/test/extended/testdata/deployments/generation-test.yaml +++ b/test/extended/testdata/deployments/generation-test.yaml @@ -22,7 +22,7 @@ spec: name: generation-test spec: containers: - - image: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + - image: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" imagePullPolicy: IfNotPresent name: myapp command: diff --git a/test/extended/testdata/deployments/paused-deployment.yaml b/test/extended/testdata/deployments/paused-deployment.yaml index cf895b0f41ed..958a8036b679 100644 --- a/test/extended/testdata/deployments/paused-deployment.yaml +++ b/test/extended/testdata/deployments/paused-deployment.yaml @@ -11,7 +11,7 @@ spec: name: paused spec: containers: - - image: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + - image: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" imagePullPolicy: IfNotPresent name: myapp command: diff --git a/test/extended/testdata/deployments/readiness-test.yaml b/test/extended/testdata/deployments/readiness-test.yaml index 17ae13ab1ce3..3b5e83065d04 100644 --- a/test/extended/testdata/deployments/readiness-test.yaml +++ b/test/extended/testdata/deployments/readiness-test.yaml @@ -17,7 +17,7 @@ spec: - command: - /bin/sleep - "infinity" - image: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + image: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" imagePullPolicy: IfNotPresent name: never-ready readinessProbe: diff --git a/test/extended/testdata/deployments/tag-images-deployment.yaml b/test/extended/testdata/deployments/tag-images-deployment.yaml index fb6f605a2024..c1381efd68f5 100644 --- a/test/extended/testdata/deployments/tag-images-deployment.yaml +++ b/test/extended/testdata/deployments/tag-images-deployment.yaml @@ -23,9 +23,11 @@ spec: labels: name: tag-images spec: + terminationGracePeriodSeconds: 1 containers: - - image: openshift/origin-pod + - image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest imagePullPolicy: IfNotPresent + command: ["/bin/sh", "-c", "sleep 300"] name: sample-name ports: - containerPort: 8080 diff --git a/test/extended/testdata/deployments/test-deployment-broken.yaml b/test/extended/testdata/deployments/test-deployment-broken.yaml index e0cb239e5b33..13041ea9c98d 100644 --- a/test/extended/testdata/deployments/test-deployment-broken.yaml +++ b/test/extended/testdata/deployments/test-deployment-broken.yaml @@ -21,7 +21,7 @@ spec: name: brokendeployment spec: containers: - - image: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + - image: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" imagePullPolicy: IfNotPresent name: myapp command: diff --git a/test/extended/testdata/deployments/test-deployment-test.yaml b/test/extended/testdata/deployments/test-deployment-test.yaml index 55890b8b7dd1..4cc2fcf47b15 100644 --- a/test/extended/testdata/deployments/test-deployment-test.yaml +++ b/test/extended/testdata/deployments/test-deployment-test.yaml @@ -26,7 +26,7 @@ spec: spec: terminationGracePeriodSeconds: 0 containers: - - image: "registry.access.redhat.com/ubi8/ubi-minimal:latest" + - image: "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" imagePullPolicy: IfNotPresent name: myapp command: diff --git a/test/extended/testdata/image/test-image.json b/test/extended/testdata/image/test-image.json index bd814a19c846..33e473330abb 100644 --- a/test/extended/testdata/image/test-image.json +++ b/test/extended/testdata/image/test-image.json @@ -5,7 +5,7 @@ "name": "test", "creationTimestamp": null }, - "dockerImageReference": "registry.redhat.io/rhscl/ruby-25-rhel7:latest", + "dockerImageReference": "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5", "dockerImageMetadata": { "kind": "DockerImage", "apiVersion": "1.0", diff --git a/test/extended/testdata/imagestream-jenkins-slave-pods.yaml b/test/extended/testdata/imagestream-jenkins-slave-pods.yaml index 560ffc778e51..e52f393769b7 100644 --- a/test/extended/testdata/imagestream-jenkins-slave-pods.yaml +++ b/test/extended/testdata/imagestream-jenkins-slave-pods.yaml @@ -7,8 +7,9 @@ metadata: spec: tags: - from: - kind: DockerImage - name: docker.io/openshift/jenkins-slave-maven-centos7:latest + kind: ImageStreamTag + name: jenkins-agent-maven:latest + namespace: openshift name: base - from: kind: ImageStreamTag diff --git a/test/extended/testdata/imagestreamtag-jenkins-slave-pods.yaml b/test/extended/testdata/imagestreamtag-jenkins-slave-pods.yaml index 6d9697f7e093..51d9ed124f3d 100644 --- a/test/extended/testdata/imagestreamtag-jenkins-slave-pods.yaml +++ b/test/extended/testdata/imagestreamtag-jenkins-slave-pods.yaml @@ -5,8 +5,9 @@ metadata: spec: tags: - from: - kind: DockerImage - name: quay.io/openshift/origin-jenkins-agent-maven:latest + kind: ImageStreamTag + name: jenkins-agent-maven:latest + namespace: openshift name: base - annotations: role: jenkins-slave diff --git a/test/extended/testdata/jenkins-plugin/multitag-template.json b/test/extended/testdata/jenkins-plugin/multitag-template.json index 305714bd1a1e..f9f942c9594d 100644 --- a/test/extended/testdata/jenkins-plugin/multitag-template.json +++ b/test/extended/testdata/jenkins-plugin/multitag-template.json @@ -18,7 +18,7 @@ "name": "orig", "from": { "kind": "DockerImage", - "name": "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" } } ] @@ -36,7 +36,7 @@ "name": "orig", "from": { "kind": "DockerImage", - "name": "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" } } ] @@ -54,7 +54,7 @@ "name": "orig", "from": { "kind": "DockerImage", - "name": "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" } } ] diff --git a/test/extended/testdata/jobs/v1.yaml b/test/extended/testdata/jobs/v1.yaml index 51ab23652802..604940de3dc8 100644 --- a/test/extended/testdata/jobs/v1.yaml +++ b/test/extended/testdata/jobs/v1.yaml @@ -11,6 +11,6 @@ spec: spec: containers: - name: simplev1 - image: docker.io/busybox + image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest command: ["/bin/sh", "-c", "exit 0"] restartPolicy: Never diff --git a/test/extended/testdata/long_names/fixture.json b/test/extended/testdata/long_names/fixture.json index 1a7f51a68f3a..a615d6760cbe 100644 --- a/test/extended/testdata/long_names/fixture.json +++ b/test/extended/testdata/long_names/fixture.json @@ -26,7 +26,7 @@ "sourceStrategy": { "from": { "kind": "DockerImage", - "name": "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" } } } @@ -55,7 +55,7 @@ "sourceStrategy": { "from": { "kind": "DockerImage", - "name": "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" } } } diff --git a/test/extended/testdata/router/ingress.yaml b/test/extended/testdata/router/ingress.yaml index 8f8ca483971e..94205b964e86 100644 --- a/test/extended/testdata/router/ingress.yaml +++ b/test/extended/testdata/router/ingress.yaml @@ -79,7 +79,8 @@ items: terminationGracePeriodSeconds: 1 containers: - name: test - image: openshift/hello-openshift + image: k8s.gcr.io/e2e-test-images/agnhost:2.20 + args: ["netexec"] ports: - containerPort: 8080 name: http @@ -96,7 +97,8 @@ items: terminationGracePeriodSeconds: 1 containers: - name: test - image: openshift/hello-openshift + image: k8s.gcr.io/e2e-test-images/agnhost:2.20 + args: ["netexec"] ports: - containerPort: 8080 name: http diff --git a/test/extended/testdata/router/reencrypt-serving-cert.yaml b/test/extended/testdata/router/reencrypt-serving-cert.yaml index cb8fa49af6f5..a433b4378cf1 100644 --- a/test/extended/testdata/router/reencrypt-serving-cert.yaml +++ b/test/extended/testdata/router/reencrypt-serving-cert.yaml @@ -9,7 +9,7 @@ items: app: serving-cert spec: containers: - - image: nginx:1.15.3 + - image: docker.io/library/nginx:1.15-alpine name: serve command: - /usr/sbin/nginx diff --git a/test/extended/testdata/router/router-common.yaml b/test/extended/testdata/router/router-common.yaml index 198449377c15..0c6c3550aef1 100644 --- a/test/extended/testdata/router/router-common.yaml +++ b/test/extended/testdata/router/router-common.yaml @@ -99,8 +99,8 @@ objects: terminationGracePeriodSeconds: 1 containers: - name: test - image: openshift/hello-openshift - # image: openshift/deployment-example:v1 + image: k8s.gcr.io/e2e-test-images/agnhost:2.20 + args: ["netexec"] ports: - containerPort: 8080 name: http diff --git a/test/extended/testdata/router/router-config-manager.yaml b/test/extended/testdata/router/router-config-manager.yaml index 4f47ca4084c1..2d88d4886a69 100644 --- a/test/extended/testdata/router/router-config-manager.yaml +++ b/test/extended/testdata/router/router-config-manager.yaml @@ -136,7 +136,8 @@ objects: terminationGracePeriodSeconds: 1 containers: - name: test - image: openshift/hello-openshift + image: k8s.gcr.io/e2e-test-images/agnhost:2.20 + args: ["netexec"] ports: - containerPort: 8080 name: http @@ -150,7 +151,7 @@ objects: app: secure-endpoint spec: containers: - - image: nginx:1.15.3 + - image: docker.io/library/nginx:1.15-alpine name: serve command: - /usr/sbin/nginx diff --git a/test/extended/testdata/router/router-http-echo-server.yaml b/test/extended/testdata/router/router-http-echo-server.yaml index ad793cb92bc4..eb7e9401a97b 100644 --- a/test/extended/testdata/router/router-http-echo-server.yaml +++ b/test/extended/testdata/router/router-http-echo-server.yaml @@ -20,7 +20,7 @@ items: deploymentconfig: router-http-echo spec: containers: - - image: openshift/origin-node + - image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest name: router-http-echo command: - /usr/bin/socat diff --git a/test/extended/testdata/router/router-metrics.yaml b/test/extended/testdata/router/router-metrics.yaml index 7db21a010d39..b8e235b37037 100644 --- a/test/extended/testdata/router/router-metrics.yaml +++ b/test/extended/testdata/router/router-metrics.yaml @@ -80,7 +80,8 @@ items: terminationGracePeriodSeconds: 1 containers: - name: test - image: openshift/hello-openshift + image: k8s.gcr.io/e2e-test-images/agnhost:2.20 + args: ["netexec"] ports: - containerPort: 8080 name: http @@ -97,7 +98,8 @@ items: terminationGracePeriodSeconds: 1 containers: - name: test - image: openshift/hello-openshift + image: k8s.gcr.io/e2e-test-images/agnhost:2.20 + args: ["netexec"] ports: - containerPort: 8080 name: http diff --git a/test/extended/testdata/router/weighted-router.yaml b/test/extended/testdata/router/weighted-router.yaml index 6a0c1ddfffa9..d29aea59e9bd 100644 --- a/test/extended/testdata/router/weighted-router.yaml +++ b/test/extended/testdata/router/weighted-router.yaml @@ -122,7 +122,8 @@ objects: terminationGracePeriodSeconds: 1 containers: - name: test - image: openshift/hello-openshift + image: k8s.gcr.io/e2e-test-images/agnhost:2.20 + args: ["netexec"] ports: - containerPort: 8080 name: http @@ -139,7 +140,8 @@ objects: terminationGracePeriodSeconds: 1 containers: - name: test - image: openshift/hello-openshift + image: k8s.gcr.io/e2e-test-images/agnhost:2.20 + args: ["netexec"] ports: - containerPort: 8080 name: http @@ -156,7 +158,8 @@ objects: terminationGracePeriodSeconds: 1 containers: - name: test - image: openshift/hello-openshift + image: k8s.gcr.io/e2e-test-images/agnhost:2.20 + args: ["netexec"] ports: - containerPort: 8080 name: http diff --git a/test/extended/testdata/run_policy/parallel-bc.yaml b/test/extended/testdata/run_policy/parallel-bc.yaml index d24ad9d951d1..e392342e74ba 100644 --- a/test/extended/testdata/run_policy/parallel-bc.yaml +++ b/test/extended/testdata/run_policy/parallel-bc.yaml @@ -32,7 +32,7 @@ sourceStrategy: from: kind: "DockerImage" - name: "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + name: "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" resources: {} status: lastVersion: 0 diff --git a/test/extended/testdata/run_policy/serial-bc.yaml b/test/extended/testdata/run_policy/serial-bc.yaml index c3b77d1eb84c..972e1e87ac34 100644 --- a/test/extended/testdata/run_policy/serial-bc.yaml +++ b/test/extended/testdata/run_policy/serial-bc.yaml @@ -23,7 +23,7 @@ sourceStrategy: from: kind: "DockerImage" - name: "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + name: "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" - kind: "BuildConfig" apiVersion: "v1" @@ -44,4 +44,4 @@ sourceStrategy: from: kind: "DockerImage" - name: "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + name: "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" diff --git a/test/extended/testdata/run_policy/serial-latest-only-bc.yaml b/test/extended/testdata/run_policy/serial-latest-only-bc.yaml index 3a592ae82e0a..a0c0a1660520 100644 --- a/test/extended/testdata/run_policy/serial-latest-only-bc.yaml +++ b/test/extended/testdata/run_policy/serial-latest-only-bc.yaml @@ -23,7 +23,7 @@ sourceStrategy: from: kind: "DockerImage" - name: "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + name: "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" resources: {} status: lastVersion: 0 diff --git a/test/extended/testdata/templates/templateinstance_badobject.yaml b/test/extended/testdata/templates/templateinstance_badobject.yaml index 31766824cbd4..f7fb93cdccdc 100644 --- a/test/extended/testdata/templates/templateinstance_badobject.yaml +++ b/test/extended/testdata/templates/templateinstance_badobject.yaml @@ -28,4 +28,4 @@ items: spec: containers: - name: hello-openshift - image: openshift/hello-openshift + image: k8s.gcr.io/e2e-test-images/agnhost:2.20 diff --git a/test/extended/testdata/templates/templateinstance_objectkinds.yaml b/test/extended/testdata/templates/templateinstance_objectkinds.yaml index e96055807fca..9db1c8294e14 100644 --- a/test/extended/testdata/templates/templateinstance_objectkinds.yaml +++ b/test/extended/testdata/templates/templateinstance_objectkinds.yaml @@ -40,7 +40,7 @@ items: spec: containers: - name: hello-openshift - image: openshift/hello-openshift + image: k8s.gcr.io/e2e-test-images/agnhost:2.20 - kind: Route apiVersion: v1 metadata: diff --git a/test/extended/testdata/test-cli-debug.yaml b/test/extended/testdata/test-cli-debug.yaml index 86a5b35f10ec..82436082bfd5 100644 --- a/test/extended/testdata/test-cli-debug.yaml +++ b/test/extended/testdata/test-cli-debug.yaml @@ -15,7 +15,7 @@ items: type: Docker source: type: Git - dockerfile: "FROM busybox:latest\n" + dockerfile: "FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest\n" output: to: kind: ImageStreamTag @@ -94,7 +94,7 @@ items: spec: containers: - name: busybox - image: busybox + image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest - kind: DeploymentConfig apiVersion: v1 @@ -111,7 +111,7 @@ items: spec: containers: - name: busybox - image: busybox + image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest command: - foo - bar diff --git a/test/extended/testdata/test-deployment-config.yaml b/test/extended/testdata/test-deployment-config.yaml index ce3436dc507b..6f46ae18eba6 100644 --- a/test/extended/testdata/test-deployment-config.yaml +++ b/test/extended/testdata/test-deployment-config.yaml @@ -23,7 +23,7 @@ spec: name: test-deployment spec: containers: - - image: openshift/origin-pod + - image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest imagePullPolicy: IfNotPresent name: ruby-helloworld ports: diff --git a/test/extended/testdata/test-env-pod.json b/test/extended/testdata/test-env-pod.json index 766767a7ddc4..6f4f34d2d8be 100644 --- a/test/extended/testdata/test-env-pod.json +++ b/test/extended/testdata/test-env-pod.json @@ -11,7 +11,7 @@ "containers":[ { "name":"test", - "image":"centos:centos7", + "image":"image-registry.openshift-image-registry.svc:5000/openshift/tools:latest", "env": [ { "name":"podname", diff --git a/test/extended/testdata/test-replication-controller.yaml b/test/extended/testdata/test-replication-controller.yaml index 4172877ce01d..fe5da07f9374 100644 --- a/test/extended/testdata/test-replication-controller.yaml +++ b/test/extended/testdata/test-replication-controller.yaml @@ -19,7 +19,7 @@ spec: deploymentconfig: test-deployment spec: containers: - - image: openshift/origin-pod + - image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest imagePullPolicy: IfNotPresent name: ruby-helloworld ports: diff --git a/test/extended/topology_manager/utils.go b/test/extended/topology_manager/utils.go index 7b636e7e8231..cfebf7ec4d72 100644 --- a/test/extended/topology_manager/utils.go +++ b/test/extended/topology_manager/utils.go @@ -13,6 +13,7 @@ import ( "time" exutil "github.com/openshift/origin/test/extended/util" + "github.com/openshift/origin/test/extended/util/image" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" @@ -250,7 +251,7 @@ func makeBusyboxPod(namespace string) *corev1.Pod { Containers: []corev1.Container{ { Name: "test", - Image: "busybox", + Image: image.ShellImage(), Command: []string{"sleep", "10h"}, }, }, diff --git a/test/extended/util/annotate/generated/zz_generated.annotations.go b/test/extended/util/annotate/generated/zz_generated.annotations.go index ef3df3756fca..ba94add7f785 100644 --- a/test/extended/util/annotate/generated/zz_generated.annotations.go +++ b/test/extended/util/annotate/generated/zz_generated.annotations.go @@ -1101,7 +1101,7 @@ var annotations = map[string]string{ "[Top Level] [sig-autoscaling] [HPA] Horizontal pod autoscaling (scale resource: Custom Metrics from Stackdriver) should scale up with two metrics of type Pod from Stackdriver [Feature:CustomMetricsAutoscaling]": "should scale up with two metrics of type Pod from Stackdriver [Feature:CustomMetricsAutoscaling] [Skipped:gce] [Suite:openshift/conformance/parallel] [Suite:k8s]", - "[Top Level] [sig-builds][Feature:Builds] Multi-stage image builds should succeed": "should succeed [Suite:openshift/conformance/parallel]", + "[Top Level] [sig-builds][Feature:Builds] Multi-stage image builds should succeed": "should succeed [Suite:openshift/conformance/parallel]", "[Top Level] [sig-builds][Feature:Builds] Optimized image builds should succeed": "should succeed [Suite:openshift/conformance/parallel]", diff --git a/test/extended/util/framework.go b/test/extended/util/framework.go index b75a3584787a..bb21f97a9a8e 100644 --- a/test/extended/util/framework.go +++ b/test/extended/util/framework.go @@ -1477,18 +1477,13 @@ func assetFilePath(dir, name string) string { // FetchURL grabs the output from the specified url and returns it. // It will retry once per second for duration retryTimeout if an error occurs during the request. func FetchURL(oc *CLI, url string, retryTimeout time.Duration) (string, error) { - ns := oc.KubeFramework().Namespace.Name - execPodName := CreateExecPodOrFail(oc.AdminKubeClient().CoreV1(), ns, string(uuid.NewUUID())) + execPod := CreateExecPodOrFail(oc.AdminKubeClient(), ns, string(uuid.NewUUID())) defer func() { - oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPodName, *metav1.NewDeleteOptions(1)) + oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPod.Name, *metav1.NewDeleteOptions(1)) }() - execPod, err := oc.AdminKubeClient().CoreV1().Pods(ns).Get(context.Background(), execPodName, metav1.GetOptions{}) - if err != nil { - return "", err - } - + var err error var response string waitFn := func() (bool, error) { e2e.Logf("Waiting up to %v to wget %s", retryTimeout, url) @@ -1593,26 +1588,6 @@ func GetEndpointAddress(oc *CLI, name string) (string, error) { return fmt.Sprintf("%s:%d", endpoint.Subsets[0].Addresses[0].IP, endpoint.Subsets[0].Ports[0].Port), nil } -// CreateExecPodOrFail creates a simple busybox pod in a sleep loop used as a -// vessel for kubectl exec commands. -// Returns the name of the created pod. -// TODO: expose upstream -func CreateExecPodOrFail(client corev1client.CoreV1Interface, ns, name string) string { - e2e.Logf("Creating new exec pod") - execPod := e2epod.NewExecPodSpec(ns, name, false) - created, err := client.Pods(ns).Create(context.Background(), execPod, metav1.CreateOptions{}) - o.Expect(err).NotTo(o.HaveOccurred()) - err = wait.PollImmediate(e2e.Poll, 5*time.Minute, func() (bool, error) { - retrievedPod, err := client.Pods(execPod.Namespace).Get(context.Background(), created.Name, metav1.GetOptions{}) - if err != nil { - return false, nil - } - return retrievedPod.Status.Phase == corev1.PodRunning, nil - }) - o.Expect(err).NotTo(o.HaveOccurred()) - return created.Name -} - // CheckForBuildEvent will poll a build for up to 1 minute looking for an event with // the specified reason and message template. func CheckForBuildEvent(client corev1client.CoreV1Interface, build *buildv1.Build, reason, message string) { @@ -1898,37 +1873,6 @@ func GetRouterPodTemplate(oc *CLI) (*corev1.PodTemplateSpec, string, error) { return nil, "", kapierrs.NewNotFound(schema.GroupResource{Group: "apps.openshift.io", Resource: "deploymentconfigs"}, "router") } -// FindImageFormatString returns a format string for components on the cluster. It returns false -// if no format string could be inferred from the cluster. OpenShift 4.0 clusters will not be able -// to infer an image format string, so you must wrap this method in one that can locate your specific -// image. -func FindImageFormatString(oc *CLI) (string, bool) { - // legacy support for 3.x clusters - template, _, err := GetRouterPodTemplate(oc) - if err == nil { - if strings.Contains(template.Spec.Containers[0].Image, "haproxy-router") { - return strings.Replace(template.Spec.Containers[0].Image, "haproxy-router", "${component}", -1), true - } - } - // in openshift 4.0, no image format can be calculated on cluster - return "openshift/origin-${component}:latest", false -} - -func FindCLIImage(oc *CLI) (string, bool) { - // look up image stream - is, err := oc.AdminImageClient().ImageV1().ImageStreams("openshift").Get(context.Background(), "cli", metav1.GetOptions{}) - if err == nil { - for _, tag := range is.Spec.Tags { - if tag.Name == "latest" && tag.From != nil && tag.From.Kind == "DockerImage" { - return tag.From.Name, true - } - } - } - - format, ok := FindImageFormatString(oc) - return strings.Replace(format, "${component}", "cli", -1), ok -} - func FindRouterImage(oc *CLI) (string, error) { configclient := oc.AdminConfigClient().ConfigV1() o, err := configclient.ClusterOperators().Get(context.Background(), "ingress", metav1.GetOptions{}) diff --git a/test/extended/util/image/image.go b/test/extended/util/image/image.go index 54083c718031..02657b109edc 100644 --- a/test/extended/util/image/image.go +++ b/test/extended/util/image/image.go @@ -14,17 +14,34 @@ func init() { // used by open ldap tests "docker.io/mrogers950/origin-openldap-test:fedora29": -1, - // part of CSI tests - "quay.io/k8scsi/csi-attacher:v2.1.0": -1, - "quay.io/k8scsi/csi-node-driver-registrar:v1.2.0": -1, - "quay.io/k8scsi/csi-provisioner:v1.5.0": -1, - "quay.io/k8scsi/csi-snapshotter:v2.0.0": -1, - "quay.io/k8scsi/hostpathplugin:v1.4.0-rc2": -1, - "quay.io/k8scsi/livenessprobe:v1.1.0": -1, - "quay.io/k8scsi/mock-driver": -1, - - // allowed upstream kube images - index and value must match - "docker.io/library/nginx:1.15-alpine": 24, + // used by multicast test, should be moved to publish to quay + "docker.io/openshift/test-multicast:latest": -1, + + // used by oc mirror test, should be moved to publish to quay + "docker.io/library/registry:2.7.1": -1, + + // moved to GCR + "k8s.gcr.io/sig-storage/csi-attacher:v2.2.0": -1, + "k8s.gcr.io/sig-storage/csi-attacher:v3.0.0": -1, + "k8s.gcr.io/sig-storage/csi-node-driver-registrar:v1.2.0": -1, + "k8s.gcr.io/sig-storage/csi-node-driver-registrar:v1.3.0": -1, + "k8s.gcr.io/sig-storage/csi-provisioner:v1.6.0": -1, + "k8s.gcr.io/sig-storage/csi-provisioner:v2.0.0": -1, + "k8s.gcr.io/sig-storage/csi-resizer:v0.4.0": -1, + "k8s.gcr.io/sig-storage/csi-resizer:v0.5.0": -1, + "k8s.gcr.io/sig-storage/csi-snapshotter:v2.0.1": -1, + "k8s.gcr.io/sig-storage/csi-snapshotter:v2.1.0": -1, + "k8s.gcr.io/sig-storage/hostpathplugin:v1.4.0": -1, + "k8s.gcr.io/sig-storage/livenessprobe:v1.1.0": -1, + "k8s.gcr.io/sig-storage/mock-driver:v3.1.0": -1, + "k8s.gcr.io/sig-storage/snapshot-controller:v2.1.1": -1, + + // allowed upstream kube images - index and value must match upstream or + // tests will fail + "k8s.gcr.io/e2e-test-images/agnhost:2.20": 1, + "docker.io/library/nginx:1.14-alpine": 23, + "docker.io/library/nginx:1.15-alpine": 24, + "docker.io/library/redis:5.0.5-alpine": 31, } images = GetMappedImages(allowedImages, os.Getenv("KUBE_TEST_REPO")) @@ -94,12 +111,23 @@ func ShellImage() string { return "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" } +// LimitedShellImage returns a docker pull spec that any pod on the cluster +// has access to that contains bash and standard commandline tools. +// This image should be used when you only need oc and can't use the shell image. +// This image has oc. +// +// TODO: this will be removed when https://bugzilla.redhat.com/show_bug.cgi?id=1843232 +// is fixed +func LimitedShellImage() string { + return "image-registry.openshift-image-registry.svc:5000/openshift/cli:latest" +} + // OpenLDAPTestImage returns the LDAP test image. func OpenLDAPTestImage() string { return LocationFor("docker.io/mrogers950/origin-openldap-test:fedora29") } -// OriginalImages() returns a map of the original image namesp +// OriginalImages returns a map of the original image names. func OriginalImages() map[string]int { images := make(map[string]int) for k, v := range allowedImages { diff --git a/test/extended/util/image/zz_generated.txt b/test/extended/util/image/zz_generated.txt new file mode 100644 index 000000000000..90387950142c --- /dev/null +++ b/test/extended/util/image/zz_generated.txt @@ -0,0 +1,52 @@ +# This file is generated by hack/update-generated-bindata.sh +docker.io/gluster/glusterdynamic-provisioner:v1.0 quay.io/openshift/community-e2e-images:e2e-14-docker-io-gluster-glusterdynamic-provisioner-v1-0-KoXS0hk-A1Z9s5b8 +docker.io/library/busybox:1.29 quay.io/openshift/community-e2e-images:e2e-7-docker-io-library-busybox-1-29-pBq11zdTXE-KGsre +docker.io/library/httpd:2.4.38-alpine quay.io/openshift/community-e2e-images:e2e-15-docker-io-library-httpd-2-4-38-alpine-PcS4HbFNhO5PfBub +docker.io/library/httpd:2.4.39-alpine quay.io/openshift/community-e2e-images:e2e-16-docker-io-library-httpd-2-4-39-alpine-Gj-c8OFZVVxvtHu2 +docker.io/library/nginx:1.14-alpine quay.io/openshift/community-e2e-images:e2e-23-docker-io-library-nginx-1-14-alpine-yxm61cIl0fz2I0Zz +docker.io/library/nginx:1.15-alpine quay.io/openshift/community-e2e-images:e2e-24-docker-io-library-nginx-1-15-alpine-l2aP4Mr7LpVdV6gu +docker.io/library/perl:5.26 quay.io/openshift/community-e2e-images:e2e-28-docker-io-library-perl-5-26-FBqTQxmHsu0UjDlZ +docker.io/library/redis:5.0.5-alpine quay.io/openshift/community-e2e-images:e2e-31-docker-io-library-redis-5-0-5-alpine-dd1_y0PD70cxSx_m +docker.io/library/registry:2.7.1 quay.io/openshift/community-e2e-images:e2e-docker-io-library-registry-2-7-1-g9zRqt2aidLQrnbe +docker.io/mrogers950/origin-openldap-test:fedora29 quay.io/openshift/community-e2e-images:e2e-docker-io-mrogers950-origin-openldap-test-fedora29-spJ_eLUO2k2GFYK_ +docker.io/openshift/test-multicast:latest quay.io/openshift/community-e2e-images:e2e-docker-io-openshift-test-multicast-latest-4AxcBBxKg_prX34z +gcr.io/kubernetes-e2e-test-images/apparmor-loader:1.0 quay.io/openshift/community-e2e-images:e2e-4-gcr-io-kubernetes-e2e-test-images-apparmor-loader-1-0-aNcoUDFEmADPugAY +gcr.io/kubernetes-e2e-test-images/cuda-vector-add:1.0 quay.io/openshift/community-e2e-images:e2e-9-gcr-io-kubernetes-e2e-test-images-cuda-vector-add-1-0-8kiue1R1E2L4K4Cu +gcr.io/kubernetes-e2e-test-images/cuda-vector-add:2.0 quay.io/openshift/community-e2e-images:e2e-10-gcr-io-kubernetes-e2e-test-images-cuda-vector-add-2-0-athN2DOyoc4ux5JO +gcr.io/kubernetes-e2e-test-images/echoserver:2.2 quay.io/openshift/community-e2e-images:e2e-12-gcr-io-kubernetes-e2e-test-images-echoserver-2-2-flifUTtzBQYThevq +gcr.io/kubernetes-e2e-test-images/ipc-utils:1.0 quay.io/openshift/community-e2e-images:e2e-18-gcr-io-kubernetes-e2e-test-images-ipc-utils-1-0-bVpFSazzlPF0h7Sh +gcr.io/kubernetes-e2e-test-images/jessie-dnsutils:1.0 quay.io/openshift/community-e2e-images:e2e-19-gcr-io-kubernetes-e2e-test-images-jessie-dnsutils-1-0-eIx8izd3E579FYKJ +gcr.io/kubernetes-e2e-test-images/kitten:1.0 quay.io/openshift/community-e2e-images:e2e-20-gcr-io-kubernetes-e2e-test-images-kitten-1-0-nyaXRBZKp1MUalek +gcr.io/kubernetes-e2e-test-images/metadata-concealment:1.2 quay.io/openshift/community-e2e-images:e2e-8-gcr-io-kubernetes-e2e-test-images-metadata-concealment-1-2-hVXHl0CaKh0yxj30 +gcr.io/kubernetes-e2e-test-images/nautilus:1.0 quay.io/openshift/community-e2e-images:e2e-21-gcr-io-kubernetes-e2e-test-images-nautilus-1-0-ot9uKfkPJ1nHoaa5 +gcr.io/kubernetes-e2e-test-images/nonewprivs:1.0 quay.io/openshift/community-e2e-images:e2e-25-gcr-io-kubernetes-e2e-test-images-nonewprivs-1-0-99FQZQqpju_wLImS +gcr.io/kubernetes-e2e-test-images/nonroot:1.0 quay.io/openshift/community-e2e-images:e2e-26-gcr-io-kubernetes-e2e-test-images-nonroot-1-0-6UP--2eZSLen4EJ- +gcr.io/kubernetes-e2e-test-images/regression-issue-74839-amd64:1.0 quay.io/openshift/community-e2e-images:e2e-32-gcr-io-kubernetes-e2e-test-images-regression-issue-74839-amd64-1-0-zKI5eDEBSTF6x1_L +gcr.io/kubernetes-e2e-test-images/resource-consumer:1.5 quay.io/openshift/community-e2e-images:e2e-33-gcr-io-kubernetes-e2e-test-images-resource-consumer-1-5-dkUnrzChb3aARMbw +gcr.io/kubernetes-e2e-test-images/sample-apiserver:1.17 quay.io/openshift/community-e2e-images:e2e-3-gcr-io-kubernetes-e2e-test-images-sample-apiserver-1-17-NgZupChxq-wmkUzw +gcr.io/kubernetes-e2e-test-images/volume/gluster:1.0 quay.io/openshift/community-e2e-images:e2e-37-gcr-io-kubernetes-e2e-test-images-volume-gluster-1-0-gLYeM8gU2klsD8wi +gcr.io/kubernetes-e2e-test-images/volume/iscsi:2.0 quay.io/openshift/community-e2e-images:e2e-36-gcr-io-kubernetes-e2e-test-images-volume-iscsi-2-0-RuKnuHHE9bwOcqDI +gcr.io/kubernetes-e2e-test-images/volume/nfs:1.0 quay.io/openshift/community-e2e-images:e2e-35-gcr-io-kubernetes-e2e-test-images-volume-nfs-1-0-AW-qOVYbJYyLsrEa +gcr.io/kubernetes-e2e-test-images/volume/rbd:1.0.1 quay.io/openshift/community-e2e-images:e2e-38-gcr-io-kubernetes-e2e-test-images-volume-rbd-1-0-1-ijh6-o3bvnWWIAFM +k8s.gcr.io/build-image/debian-iptables:v12.1.2 quay.io/openshift/community-e2e-images:e2e-11-k8s-gcr-io-build-image-debian-iptables-v12-1-2-KNXT7NtTs4Px1rYf +k8s.gcr.io/e2e-test-images/agnhost:2.20 quay.io/openshift/community-e2e-images:e2e-1-k8s-gcr-io-e2e-test-images-agnhost-2-20-1f8SSDq8Y3dr2Xfm +k8s.gcr.io/etcd:3.4.13-0 quay.io/openshift/community-e2e-images:e2e-13-k8s-gcr-io-etcd-3-4-13-0-VKSltRW2wd8-QWft +k8s.gcr.io/pause:3.2 quay.io/openshift/community-e2e-images:e2e-27-k8s-gcr-io-pause-3-2-pZ7kB8CESdFpJJRs +k8s.gcr.io/prometheus-dummy-exporter:v0.1.0 quay.io/openshift/community-e2e-images:e2e-29-k8s-gcr-io-prometheus-dummy-exporter-v0-1-0-fNZIUrKnAwcvKTvF +k8s.gcr.io/prometheus-to-sd:v0.5.0 quay.io/openshift/community-e2e-images:e2e-30-k8s-gcr-io-prometheus-to-sd-v0-5-0-6JI59Yih4oaj3oQO +k8s.gcr.io/sd-dummy-exporter:v0.2.0 quay.io/openshift/community-e2e-images:e2e-34-k8s-gcr-io-sd-dummy-exporter-v0-2-0-pPp4DDTpVamU2YNi +k8s.gcr.io/sig-storage/csi-attacher:v2.2.0 quay.io/openshift/community-e2e-images:e2e-k8s-gcr-io-sig-storage-csi-attacher-v2-2-0-rkWV0rp07ep86NLk +k8s.gcr.io/sig-storage/csi-attacher:v3.0.0 quay.io/openshift/community-e2e-images:e2e-k8s-gcr-io-sig-storage-csi-attacher-v3-0-0-aRfAQ93WCiGD8Zvq +k8s.gcr.io/sig-storage/csi-node-driver-registrar:v1.2.0 quay.io/openshift/community-e2e-images:e2e-k8s-gcr-io-sig-storage-csi-node-driver-registrar-v1-2-0-61xf9FtqLwOVEKfv +k8s.gcr.io/sig-storage/csi-node-driver-registrar:v1.3.0 quay.io/openshift/community-e2e-images:e2e-k8s-gcr-io-sig-storage-csi-node-driver-registrar-v1-3-0-2QBE0hLaWwzOxqR6 +k8s.gcr.io/sig-storage/csi-provisioner:v1.6.0 quay.io/openshift/community-e2e-images:e2e-k8s-gcr-io-sig-storage-csi-provisioner-v1-6-0-JY3N9ZcwCflk372F +k8s.gcr.io/sig-storage/csi-provisioner:v2.0.0 quay.io/openshift/community-e2e-images:e2e-k8s-gcr-io-sig-storage-csi-provisioner-v2-0-0-twLyh6EaAecaDbK8 +k8s.gcr.io/sig-storage/csi-resizer:v0.4.0 quay.io/openshift/community-e2e-images:e2e-k8s-gcr-io-sig-storage-csi-resizer-v0-4-0-XqHBnRtAgovNyXK3 +k8s.gcr.io/sig-storage/csi-resizer:v0.5.0 quay.io/openshift/community-e2e-images:e2e-k8s-gcr-io-sig-storage-csi-resizer-v0-5-0-O79EW2-1fDT39X15 +k8s.gcr.io/sig-storage/csi-snapshotter:v2.0.1 quay.io/openshift/community-e2e-images:e2e-k8s-gcr-io-sig-storage-csi-snapshotter-v2-0-1-NIPtB_SC-LRqBaeq +k8s.gcr.io/sig-storage/csi-snapshotter:v2.1.0 quay.io/openshift/community-e2e-images:e2e-k8s-gcr-io-sig-storage-csi-snapshotter-v2-1-0-1kbgyjhsZ5sWpBwq +k8s.gcr.io/sig-storage/hostpathplugin:v1.4.0 quay.io/openshift/community-e2e-images:e2e-k8s-gcr-io-sig-storage-hostpathplugin-v1-4-0-AfY5JyX6DsfCefAR +k8s.gcr.io/sig-storage/livenessprobe:v1.1.0 quay.io/openshift/community-e2e-images:e2e-k8s-gcr-io-sig-storage-livenessprobe-v1-1-0-d49j-mlARufXkhrZ +k8s.gcr.io/sig-storage/mock-driver:v3.1.0 quay.io/openshift/community-e2e-images:e2e-k8s-gcr-io-sig-storage-mock-driver-v3-1-0-PWpfweH52dPLzByS +k8s.gcr.io/sig-storage/nfs-provisioner:v2.2.2 quay.io/openshift/community-e2e-images:e2e-22-k8s-gcr-io-sig-storage-nfs-provisioner-v2-2-2-dbgtOCwYmEGggl01 +k8s.gcr.io/sig-storage/snapshot-controller:v2.1.1 quay.io/openshift/community-e2e-images:e2e-k8s-gcr-io-sig-storage-snapshot-controller-v2-1-1-n5BM_jX2npV3RxHM diff --git a/test/extended/util/pods.go b/test/extended/util/pods.go index 2ccd6757b86c..ec5b45bbd20b 100644 --- a/test/extended/util/pods.go +++ b/test/extended/util/pods.go @@ -17,6 +17,8 @@ import ( clientset "k8s.io/client-go/kubernetes" e2e "k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework/pod" + + "github.com/openshift/origin/test/extended/util/image" ) const ( @@ -62,16 +64,18 @@ func RemovePodsWithPrefixes(oc *CLI, prefixes ...string) error { return nil } -// CreateUbiExecPodOrFail creates a ubi8 pause pod used as a vessel for kubectl exec commands. +// CreateExecPodOrFail creates a pod used as a vessel for kubectl exec commands. // Pod name is uniquely generated. -func CreateUbiExecPodOrFail(client kubernetes.Interface, ns, generateName string, tweak func(*v1.Pod)) *v1.Pod { - return pod.CreateExecPodOrFail(client, ns, generateName, func(pod *v1.Pod) { - pod.Spec.Containers[0].Image = "ubi8/ubi" +func CreateExecPodOrFail(client kubernetes.Interface, ns, name string, tweak ...func(*v1.Pod)) *v1.Pod { + return pod.CreateExecPodOrFail(client, ns, name, func(pod *v1.Pod) { + pod.Name = name + pod.GenerateName = "" + pod.Spec.Containers[0].Image = image.ShellImage() pod.Spec.Containers[0].Command = []string{"sh", "-c", "trap exit TERM; while true; do sleep 5; done"} pod.Spec.Containers[0].Args = nil - if tweak != nil { - tweak(pod) + for _, fn := range tweak { + fn(pod) } }) } diff --git a/test/extended/util/url/url.go b/test/extended/util/url/url.go index 4e96700af0cb..5315ee4b70f8 100644 --- a/test/extended/util/url/url.go +++ b/test/extended/util/url/url.go @@ -15,13 +15,15 @@ import ( o "github.com/onsi/gomega" - exutil "github.com/openshift/origin/test/extended/util" v1 "k8s.io/api/core/v1" apierrs "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" kclientset "k8s.io/client-go/kubernetes" e2e "k8s.io/kubernetes/test/e2e/framework" + + exutil "github.com/openshift/origin/test/extended/util" + "github.com/openshift/origin/test/extended/util/image" ) type Tester struct { @@ -135,7 +137,7 @@ func (ut *Tester) Within(t time.Duration, tests ...*Test) { o.Expect(err).ToNot(o.HaveOccurred()) } -// createExecPod creates a simple pod in a sleep loop used as a +// createExecPod creates a simple bash pod in a sleep loop used as a // vessel for kubectl exec commands. // Returns the name of the created pod. func createExecPod(clientset kclientset.Interface, ns, name string) (string, error) { @@ -151,7 +153,7 @@ func createExecPod(clientset kclientset.Interface, ns, name string) (string, err { Command: []string{"/bin/bash", "-c", "exec sleep 10000"}, Name: "hostexec", - Image: "registry.redhat.io/rhel7:latest", + Image: image.ShellImage(), ImagePullPolicy: v1.PullIfNotPresent, }, }, @@ -181,7 +183,7 @@ func testsToScript(tests []*Test) string { testScripts := []string{ "set -euo pipefail", `function json_escape() {`, - ` python -c 'import json,sys; print json.dumps(sys.stdin.read())'`, + ` python -c 'import json,sys; print(json.dumps(sys.stdin.read()))'`, `}`, } for i, test := range tests { diff --git a/test/integration/testdata/test-buildcli.json b/test/integration/testdata/test-buildcli.json index b5db146e8fc7..5ea541415990 100644 --- a/test/integration/testdata/test-buildcli.json +++ b/test/integration/testdata/test-buildcli.json @@ -47,7 +47,7 @@ "sourceStrategy": { "from": { "kind": "DockerImage", - "name": "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" }, "incremental": true } @@ -89,7 +89,7 @@ "sourceStrategy": { "from": { "kind": "DockerImage", - "name": "registry.redhat.io/rhscl/ruby-25-rhel7:latest" + "name": "image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5" }, "incremental": true }