Skip to content

Commit

Permalink
Fix integration test kind issue
Browse files Browse the repository at this point in the history
Details: crossplane-contrib/provider-aws#782 (comment)

Signed-off-by: Hasan Turken <turkenh@gmail.com>
  • Loading branch information
turkenh committed Aug 25, 2021
1 parent 5c73fc0 commit ca2ee7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ GO111MODULE = on

# ====================================================================================
# Setup Kubernetes tools
KIND_VERSION = v0.7.0
KIND_VERSION ?= v0.11.1
KIND_NODE_IMAGE_TAG ?= v1.19.11
USE_HELM3 = true
-include build/makelib/k8s_tools.mk

Expand Down Expand Up @@ -81,7 +82,7 @@ e2e.run: test-integration
# Run integration tests.
test-integration: $(KIND) $(KUBECTL) $(HELM3)
@$(INFO) running integration tests using kind $(KIND_VERSION)
@$(ROOT_DIR)/cluster/integration/integration_tests.sh || $(FAIL)
@KIND_NODE_IMAGE_TAG=${KIND_NODE_IMAGE_TAG} $(ROOT_DIR)/cluster/local/integration_tests.sh || $(FAIL)
@$(OK) integration tests passed

# Update the submodules, such as the common build scripts.
Expand Down
5 changes: 3 additions & 2 deletions cluster/integration/integration_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ echo "created cache dir at ${CACHE_PATH}"
docker save "${BUILD_IMAGE}" -o "${CACHE_PATH}/${PACKAGE_NAME}.xpkg" && chmod 644 "${CACHE_PATH}/${PACKAGE_NAME}.xpkg"

# create kind cluster with extra mounts
echo_step "creating k8s cluster using kind"
KIND_NODE_IMAGE="kindest/node:${KIND_NODE_IMAGE_TAG}"
echo_step "creating k8s cluster using kind ${KIND_VERSION} and node image ${KIND_NODE_IMAGE}"
KIND_CONFIG="$( cat <<EOF
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
Expand All @@ -82,7 +83,7 @@ nodes:
containerPath: /cache
EOF
)"
echo "${KIND_CONFIG}" | "${KIND}" create cluster --name="${K8S_CLUSTER}" --wait=5m --config=-
echo "${KIND_CONFIG}" | "${KIND}" create cluster --name="${K8S_CLUSTER}" --wait=5m --image="${KIND_NODE_IMAGE}" --config=-

# tag controller image and load it into kind cluster
docker tag "${CONTROLLER_IMAGE}" "${PACKAGE_CONTROLLER_IMAGE}"
Expand Down

0 comments on commit ca2ee7a

Please sign in to comment.