From 1a3daeba6e5ae5b610cb52da6a224f559de71deb Mon Sep 17 00:00:00 2001 From: hasheddan Date: Wed, 30 Mar 2022 09:04:00 -0400 Subject: [PATCH 1/4] Update build subdmodule to consume up tooling Updates build submodule to consume up tooling, which provides the ability to extract package contents into a Crossplane cache compatible format. Signed-off-by: hasheddan --- build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build b/build index d393bdfee0..7be9f92190 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit d393bdfee0adf9732e32ecca8437586917fc5018 +Subproject commit 7be9f92190191771dac2cc572d2bb399bc6f2adf From c1e7a3fa18264bb57675dee5c3cf7b9dbd857237 Mon Sep 17 00:00:00 2001 From: hasheddan Date: Wed, 30 Mar 2022 09:05:42 -0400 Subject: [PATCH 2/4] Update integration tests with up xpkg xp-extract Updates integration tests with up xpkg xp-extract to allow for extracting package contents from and image into a Crossplane cache compatible format. Signed-off-by: hasheddan --- cluster/local/integration_tests.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cluster/local/integration_tests.sh b/cluster/local/integration_tests.sh index 6077c5bd23..3c039468af 100755 --- a/cluster/local/integration_tests.sh +++ b/cluster/local/integration_tests.sh @@ -42,6 +42,7 @@ eval $(make --no-print-directory -C ${projectdir} build.vars) SAFEHOSTARCH="${SAFEHOSTARCH:-amd64}" BUILD_IMAGE="${BUILD_REGISTRY}/${PROJECT_NAME}-${SAFEHOSTARCH}" +PACKAGE_IMAGE="crossplane.io/inttests/${PROJECT_NAME}:${VERSION}" CONTROLLER_IMAGE="${BUILD_REGISTRY}/${PROJECT_NAME}-controller-${SAFEHOSTARCH}" version_tag="$(cat ${projectdir}/_output/version)" @@ -68,7 +69,8 @@ echo_step "setting up local package cache" CACHE_PATH="${projectdir}/.work/inttest-package-cache" mkdir -p "${CACHE_PATH}" echo "created cache dir at ${CACHE_PATH}" -docker save "${BUILD_IMAGE}" -o "${CACHE_PATH}/${PACKAGE_NAME}.xpkg" && chmod 644 "${CACHE_PATH}/${PACKAGE_NAME}.xpkg" +docker tag "${BUILD_IMAGE}" "${PACKAGE_IMAGE}" +"${UP}" xpkg xp-extract --from-daemon "${PACKAGE_IMAGE}" -o "${CACHE_PATH}/${PACKAGE_NAME}.gz" && chmod 644 "${CACHE_PATH}/${PACKAGE_NAME}.gz" # create kind cluster with extra mounts KIND_NODE_IMAGE="kindest/node:${KIND_NODE_IMAGE_TAG}" @@ -92,7 +94,7 @@ docker tag "${CONTROLLER_IMAGE}" "${PACKAGE_CONTROLLER_IMAGE}" # files are not synced properly from host to kind node container on Jenkins, so # we must manually copy image from host to node echo_step "pre-cache package by copying to kind node" -docker cp "${CACHE_PATH}/${PACKAGE_NAME}.xpkg" "${K8S_CLUSTER}-control-plane":"/cache/${PACKAGE_NAME}.xpkg" +docker cp "${CACHE_PATH}/${PACKAGE_NAME}.gz" "${K8S_CLUSTER}-control-plane":"/cache/${PACKAGE_NAME}.gz" echo_step "create crossplane-system namespace" "${KUBECTL}" create ns crossplane-system From 3336ea2f72c51e2985ccdac316853bf283ac1d9e Mon Sep 17 00:00:00 2001 From: hasheddan Date: Wed, 30 Mar 2022 09:06:34 -0400 Subject: [PATCH 3/4] Add up dependency to test-integration target Adds up as a dependency to integration test target so it can be used in script. Signed-off-by: hasheddan --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 81cc05dbdb..3b86fd7268 100644 --- a/Makefile +++ b/Makefile @@ -85,7 +85,7 @@ manifests: e2e.run: test-integration # Run integration tests. -test-integration: $(KIND) $(KUBECTL) $(HELM3) +test-integration: $(KIND) $(KUBECTL) $(UP) $(HELM3) @$(INFO) running integration tests using kind $(KIND_VERSION) @KIND_NODE_IMAGE_TAG=${KIND_NODE_IMAGE_TAG} $(ROOT_DIR)/cluster/local/integration_tests.sh || $(FAIL) @$(OK) integration tests passed From 69a0766082f86c3d6105bf3c4a14d56ae9879ace Mon Sep 17 00:00:00 2001 From: hasheddan Date: Wed, 30 Mar 2022 09:07:47 -0400 Subject: [PATCH 4/4] Drop docker cp command used to appease Drops unneeded docker cp command that was required in Jenkins because host dir cache was not mounted correctly. Signed-off-by: hasheddan --- cluster/local/integration_tests.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cluster/local/integration_tests.sh b/cluster/local/integration_tests.sh index 3c039468af..81adcb6cfb 100755 --- a/cluster/local/integration_tests.sh +++ b/cluster/local/integration_tests.sh @@ -91,11 +91,6 @@ echo "${KIND_CONFIG}" | "${KIND}" create cluster --name="${K8S_CLUSTER}" --wait= docker tag "${CONTROLLER_IMAGE}" "${PACKAGE_CONTROLLER_IMAGE}" "${KIND}" load docker-image "${PACKAGE_CONTROLLER_IMAGE}" --name="${K8S_CLUSTER}" -# files are not synced properly from host to kind node container on Jenkins, so -# we must manually copy image from host to node -echo_step "pre-cache package by copying to kind node" -docker cp "${CACHE_PATH}/${PACKAGE_NAME}.gz" "${K8S_CLUSTER}-control-plane":"/cache/${PACKAGE_NAME}.gz" - echo_step "create crossplane-system namespace" "${KUBECTL}" create ns crossplane-system