Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building only e2e image is not possible due to misconfiguration #5019

Closed
SzekeresB opened this issue Feb 5, 2020 · 2 comments · Fixed by #5036
Closed

Building only e2e image is not possible due to misconfiguration #5019

SzekeresB opened this issue Feb 5, 2020 · 2 comments · Fixed by #5036
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@SzekeresB
Copy link
Contributor

NGINX Ingress controller version:

Kubernetes version (use kubectl version): not important

Environment: not important

What happened:

ingress-nginx/test/e2e-image$ make container
Minikube directory not found! Volume will be excluded from docker build.
Unable to find image 'quay.io/kubernetes-ingress-controller/e2e:v02042020-08e19a278' locally
v02042020-08e19a278: Pulling from kubernetes-ingress-controller/e2e
c9b1b535fdd9: Already exists
759aec7eb1a8: Pull complete
b49408c8afc4: Pull complete
fadad967ef02: Pull complete
75c2e55072a2: Pull complete
b69899e5f614: Pull complete
e8c871c34883: Pull complete
16262dedfa41: Pull complete
3a4a0e2109ec: Pull complete
7bfa1f814f80: Pull complete
af88cb563a5b: Pull complete
a0be62586af1: Pull complete
82ed8f3ef202: Pull complete
Digest: sha256:539583eab146bfd8c5ae91bddc7b10b8c5c708238d8f4e4e19779299f121d4ef
Status: Downloaded newer image for quay.io/kubernetes-ingress-controller/e2e:v02042020-08e19a278
Minikube directory not found! Volume will be excluded from docker build.
build/run-in-docker.sh: line 58: USER: unbound variable
build/run-in-docker.sh: line 58: USER: unbound variable
build/run-in-docker.sh: line 58: docker: command not found
make: *** [Makefile:204: e2e-test-binary] Error 127
Makefile:18: recipe for target 'container' failed
make: *** [container] Error 2
ingress-nginx/test/e2e-image$

What you expected to happen:

ingress-nginx/test/e2e-image$ make container
Minikube directory not found! Volume will be excluded from docker build.
Unable to find image 'quay.io/kubernetes-ingress-controller/e2e:v02042020-08e19a278' locally
v02042020-08e19a278: Pulling from kubernetes-ingress-controller/e2e
c9b1b535fdd9: Already exists
759aec7eb1a8: Pull complete
b49408c8afc4: Pull complete
fadad967ef02: Pull complete
75c2e55072a2: Pull complete
b69899e5f614: Pull complete
e8c871c34883: Pull complete
16262dedfa41: Pull complete
3a4a0e2109ec: Pull complete
7bfa1f814f80: Pull complete
af88cb563a5b: Pull complete
a0be62586af1: Pull complete
82ed8f3ef202: Pull complete
Digest: sha256:539583eab146bfd8c5ae91bddc7b10b8c5c708238d8f4e4e19779299f121d4ef
Status: Downloaded newer image for quay.io/kubernetes-ingress-controller/e2e:v02042020-08e19a278
Compiling e2e...
    compiled e2e.test
cp ../e2e/e2e.test .
cp ../e2e/wait-for-nginx.sh .
....

....
#19 sending tarball 35.0s done
#19 DONE 38.8s

#20 importing to docker
#20 DONE 4.6s
ingress-nginx/test/e2e-image$

When test container build triggered by default it set the USE_DOCKER flag true and triggers the e2e-test-binary build inside a build container @${DIR}/../../build/run-in-docker.sh make e2e-test-binary (which does not have docker-cli installed but that's the smaller problem) because inside the build container in the main Makefile
USE_DOCKER once again defaulted to true and it would like to build the e2e-test-binary inside another build container

.PHONY: e2e-test-binary
e2e-test-binary: check-go-version ## Build ginkgo binary for e2e tests.
ifeq ($(USE_DOCKER), true)
	@build/run-in-docker.sh \
		ginkgo build ./test/e2e
else

so endless recursion would occur, but as I mentioned the missing docker-cli breaks it since the docker command is not found inside the build container when it would like to spin up another build container.

How to reproduce it:

ingress-nginx/test/e2e-image$ make container

Anything else we need to know:

Solution:

diff --git a/build/run-in-docker.sh b/build/run-in-docker.sh
index f262c79c6..c44aef52b 100755
--- a/build/run-in-docker.sh
+++ b/build/run-in-docker.sh
@@ -61,6 +61,7 @@ docker run                                            \
   ${DOCKER_OPTS}                                      \
   -e GOCACHE="/go/src/${PKG}/.cache"                  \
   -e GO111MODULE=off                                  \
+  -e DIND_TASKS=true                                  \
   -v "${HOME}/.kube:${HOME}/.kube"                    \
   -v "${KUBE_ROOT}:/go/src/${PKG}"                    \
   -v "${KUBE_ROOT}/bin/${ARCH}:/go/bin/linux_${ARCH}" \

/kind bug

@SzekeresB SzekeresB added the kind/bug Categorizes issue or PR as related to a bug. label Feb 5, 2020
@aledbf
Copy link
Member

aledbf commented Feb 5, 2020

@SzekeresB pull request are welcome :)

SzekeresB added a commit to SzekeresB/ingress-nginx that referenced this issue Feb 6, 2020
@SzekeresB
Copy link
Contributor Author

I'll have to take care some stuff first but I'll come back to the pull request part ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants