Merge pull request #3819 from aledbf/fix-e2e-osx

Fix e2e test in osx
This commit is contained in:
Kubernetes Prow Robot 2019-02-26 08:41:54 -08:00 committed by GitHub
commit ec3a2d6bc7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 63 deletions

View file

@ -185,10 +185,10 @@ e2e-test:
echo "Granting permissions to ingress-nginx e2e service account..."
kubectl create serviceaccount ingress-nginx-e2e || true
kubectl create clusterrolebinding permissive-binding \
--clusterrole=cluster-admin \
--user=admin \
--user=kubelet \
--serviceaccount=default:ingress-nginx-e2e || true
--clusterrole=cluster-admin \
--user=admin \
--user=kubelet \
--serviceaccount=default:ingress-nginx-e2e || true
kubectl run --rm -i --tty \
--attach \
@ -202,12 +202,14 @@ e2e-test:
.PHONY: e2e-test-image
e2e-test-image:
make -C test/e2e-image
.PHONY: e2e-test-binary
e2e-test-binary:
@$(DEF_VARS) \
DOCKER_OPTS="-i --net=host" \
build/go-in-docker.sh build/build-e2e.sh
make -C test/e2e-image
.PHONY: cover
cover:
@$(DEF_VARS) \

View file

@ -1,17 +1,22 @@
FROM quay.io/kubernetes-ingress-controller/e2e:v02252019-286c1f306 AS BASE
FROM quay.io/kubernetes-ingress-controller/debian-base-amd64:0.1
RUN clean-install \
ca-certificates \
bash \
curl \
tzdata
COPY ginkgo /usr/local/bin/
COPY kubectl /usr/local/bin/
COPY e2e.sh /e2e.sh
RUN curl -Lo /usr/local/bin/kubectl \
https://storage.googleapis.com/kubernetes-release/release/v1.13.3/bin/linux/amd64/kubectl \
&& chmod +x /usr/local/bin/kubectl
COPY manifests /manifests
COPY --from=BASE /go/bin/ginkgo /usr/local/bin/
COPY wait-for-nginx.sh /
COPY e2e.test /
COPY e2e.sh /e2e.sh
COPY manifests /manifests
COPY wait-for-nginx.sh /
COPY e2e.test /
CMD [ "/e2e.sh" ]

View file

@ -1,17 +1,11 @@
IMAGE=nginx-ingress-controller:e2e
KUBE_VERSION ?= 1.13.3
.PHONY: all container getbins clean
all: container
container:
./kubectl > /dev/null 2>&1 || curl -Lo ./kubectl \
https://storage.googleapis.com/kubernetes-release/release/v$(KUBE_VERSION)/bin/linux/amd64/kubectl \
&& chmod +x ./kubectl
$(GOPATH)/bin/ginkgo > /dev/null 2>&1 || go get github.com/onsi/ginkgo/ginkgo
cp $(GOPATH)/bin/ginkgo .
make -C ../../ e2e-test-binary
cp ../e2e/e2e.test .
cp ../e2e/wait-for-nginx.sh .

View file

@ -1,44 +0,0 @@
#!/bin/bash
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
set -x
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export NAMESPACE=$1
echo "deploying NGINX Ingress controller in namespace $NAMESPACE"
function on_exit {
local error_code="$?"
test $error_code == 0 && return;
echo "Obtaining ingress controller pod logs..."
kubectl logs -l app.kubernetes.io/name=ingress-nginx -n $NAMESPACE
}
trap on_exit EXIT
kubectl apply --f $DIR/manifests/service.yaml
sed "s@\${NAMESPACE}@${NAMESPACE}@" $DIR/manifests/mandatory.yaml | kubectl apply --namespace=$NAMESPACE -f -
cat $DIR/manifests/service.yaml | kubectl apply --namespace=$NAMESPACE -f -
# wait for the deployment and fail if there is an error before starting the execution of any test
kubectl rollout status \
--request-timeout=3m \
--namespace $NAMESPACE \
deployment nginx-ingress-controller