tests/e2e: use imported image

pull/360/head
iwilltry42 4 years ago
parent a28ad768cc
commit d420ccf1f7
No known key found for this signature in database
GPG Key ID: 7BA57AD1CFF16110
  1. 2
      Dockerfile
  2. 9
      tests/test_full_lifecycle.sh

@ -4,7 +4,7 @@ COPY . .
RUN make build && bin/k3d version
FROM docker:19.03-dind as dind
RUN apk add bash curl sudo jq git make
RUN apk update && apk add bash curl sudo jq git make netcat-openbsd
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl && \
chmod +x ./kubectl && \
mv ./kubectl /usr/local/bin/kubectl

@ -46,11 +46,18 @@ info "Checking that we have 3 nodes available now..."
check_multi_node "$clustername" 3 || failed "failed to verify number of nodes"
# 4. load an image into the cluster
info "Loading an image into the cluster..."
info "Importing an image into the cluster..."
docker pull nginx:latest > /dev/null
docker tag nginx:latest nginx:local > /dev/null
$EXE image import nginx:local -c $clustername || failed "could not import image in $clustername"
# 5. use that image
info "Spawning a pod using the imported image..."
kubectl run --image nginx:local testimage
info "Waiting for a bit for the pod to start..."
sleep 5
kubectl get pod testimage | grep 'Running' || failed "Pod using the imported image is not running after 5 seconds"
# Cleanup
info "Deleting cluster $clustername..."

Loading…
Cancel
Save