Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions test/extended/builds/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ 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"
Expand All @@ -23,7 +22,7 @@ var _ = g.Describe("[sig-builds][Feature:Builds] build can reference a cluster s
testDockerfile = fmt.Sprintf(`
FROM %s
RUN cat /etc/resolv.conf
RUN curl -vvv hello-openshift:6379
RUN curl -vvv hello-nodejs:8080
`, image.ShellImage())
)

Expand All @@ -43,14 +42,20 @@ RUN curl -vvv hello-openshift:6379

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("--name", "hello-openshift", k8simage.GetE2EImage(k8simage.Redis)).Execute()
g.By("standing up a new hello world nodejs service via oc new-app")
err := oc.Run("new-app").Args("nodejs~https://github.com/sclorg/nodejs-ex.git", "--name", "hello-nodejs").Execute()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've occasionally been curious on the side how the upcoming disconnected tests are going to deal with git cloning from the outside :-)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be "we build the image on the outside with the Git bits already installed, and then mirror the built image into the restricted-network environment before running the tests"? That would make cloning-from-Git or other on-the-fly internet access technical debt that we'd have to clean out before we had the test-case green in restricted-networks where that internet access is not available.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can - yes
do it in relatively minimal cycles like this change - no .... a much much much more involved change based on other recent build test image work we have had to wrt the disconnected e2e stuff

short term, e2e-aws-proxy needs to be unblocked

but as I mentioned to @adambkaplan in slack, our team needs to huddle up at some point and see how we will deal with the git cloning elements of our e2e's (which aside from testing git clone, test several of the upstream s2i base image implementations as part of vetting those)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's going to be a much bigger endeavor. "Clone source from git over the internet" is the most basic thing OCP builds do, and we do it everywhere in the build suite.

Is having a fully air-gapped CI test a goal? Or is the goal having CI tests run on a cluster that is restricted, but with some caveats. Example - proxy in a DMZ that has an allowlist of domains to access.

o.Expect(err).NotTo(o.HaveOccurred())

deploy, derr := oc.KubeClient().AppsV1().Deployments(oc.Namespace()).Get(context.Background(), "hello-openshift", metav1.GetOptions{})
err = exutil.WaitForABuild(oc.BuildClient().BuildV1().Builds(oc.Namespace()), "hello-nodejs-1", nil, nil, nil)
if err != nil {
exutil.DumpBuildLogs("hello-nodejs", oc)
}
o.Expect(err).NotTo(o.HaveOccurred())

deploy, derr := oc.KubeClient().AppsV1().Deployments(oc.Namespace()).Get(context.Background(), "hello-nodejs", metav1.GetOptions{})
if kapierrs.IsNotFound(derr) {
// if deployment is not there we're working with old new-app producing deployment configs
err := exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().AppsV1(), oc.Namespace(), "hello-openshift", 1, true, oc)
err := exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().AppsV1(), oc.Namespace(), "hello-nodejs", 1, true, oc)
o.Expect(err).NotTo(o.HaveOccurred())
} else {
// if present - wait for deployment
Expand All @@ -59,7 +64,7 @@ RUN curl -vvv hello-openshift:6379
o.Expect(err).NotTo(o.HaveOccurred())
}

err = exutil.WaitForEndpoint(oc.KubeFramework().ClientSet, oc.Namespace(), "hello-openshift")
err = exutil.WaitForEndpoint(oc.KubeFramework().ClientSet, oc.Namespace(), "hello-nodejs")
o.Expect(err).NotTo(o.HaveOccurred())

g.By("calling oc new-build with a Dockerfile")
Expand Down
9 changes: 4 additions & 5 deletions test/extended/util/image/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@ func init() {

// allowed upstream kube images - index and value must match upstream or
// tests will fail (vendor/k8s.io/kubernetes/test/utils/image/manifest.go)
"k8s.gcr.io/e2e-test-images/agnhost:2.32": 1,
"k8s.gcr.io/e2e-test-images/busybox:1.29-1": 7,
"k8s.gcr.io/e2e-test-images/nginx:1.14-1": 23,
"k8s.gcr.io/e2e-test-images/nginx:1.15-1": 24,
"k8s.gcr.io/e2e-test-images/redis:5.0.5-alpine": 34,
"k8s.gcr.io/e2e-test-images/agnhost:2.32": 1,
"k8s.gcr.io/e2e-test-images/busybox:1.29-1": 7,
"k8s.gcr.io/e2e-test-images/nginx:1.14-1": 23,
"k8s.gcr.io/e2e-test-images/nginx:1.15-1": 24,
}

images = GetMappedImages(allowedImages, os.Getenv("KUBE_TEST_REPO"))
Expand Down