Skip to content

Commit

Permalink
Merge pull request #2004 from MisterMX/fix/e2e-testing
Browse files Browse the repository at this point in the history
chore(ci): Fix e2e tests
  • Loading branch information
MisterMX authored Feb 21, 2024
2 parents f759905 + e0afbed commit 7c27367
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions cluster/local/integration_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ EOF
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_NAME}"
"${KIND}" load docker-image "${PACKAGE_NAME}" --name="${K8S_CLUSTER}"
PACKAGE_NAME_REF="xpkg.upbound.io/$PACKAGE_NAME"
docker tag "${CONTROLLER_IMAGE}" "${PACKAGE_NAME_REF}"
"${KIND}" load docker-image "${PACKAGE_NAME_REF}" --name="${K8S_CLUSTER}"

echo_step "create crossplane-system namespace"
"${KUBECTL}" create ns crossplane-system
Expand Down Expand Up @@ -131,7 +132,7 @@ echo "${PVC_YAML}" | "${KUBECTL}" create -f -
# install crossplane from stable channel
echo_step "installing crossplane from stable channel"
"${HELM3}" repo add crossplane-stable https://charts.crossplane.io/stable/
chart_version="$("${HELM3}" search repo crossplane-stable/crossplane | awk 'FNR == 2 {print $2}')"
chart_version="1.14.5"
echo_info "using crossplane version ${chart_version}"
echo
# we replace empty dir with our PVC so that the /cache dir in the kind node
Expand Down Expand Up @@ -163,7 +164,24 @@ docker exec "${K8S_CLUSTER}-control-plane" ls -la /cache

echo_step "waiting for provider to be installed"

kubectl wait "provider.pkg.crossplane.io/${PACKAGE_NAME}" --for=condition=healthy --timeout=180s
if ! kubectl wait "provider.pkg.crossplane.io/${PACKAGE_NAME}" --for=condition=healthy --timeout=300s ; then
echo_warn "kubectl describe provider.pkg.crossplane.io/${PACKAGE_NAME}"
kubectl describe "provider.pkg.crossplane.io/${PACKAGE_NAME}"
echo_warn "kubectl describe providerrevision.pkg.crossplane.io"
kubectl describe providerrevision.pkg.crossplane.io

DEPLOY_NAMES=$(kubectl get deploy -n "${CROSSPLANE_NAMESPACE}" -oname | grep ${PACKAGE_NAME})
for DEPLOY in $DEPLOY_NAMES; do
echo_warn "kubectl describe -n ${CROSSPLANE_NAMESPACE} $DEPLOY"
kubectl describe -n "${CROSSPLANE_NAMESPACE}" "$DEPLOY"
done

POD_NAMES=$(kubectl get pods -n "${CROSSPLANE_NAMESPACE}" -oname | grep ${PACKAGE_NAME})
for POD in $POD_NAMES; do
echo_warn "kubectl describe -n ${CROSSPLANE_NAMESPACE} $POD"
kubectl describe -n "${CROSSPLANE_NAMESPACE}" "$POD"
done
fi

echo_step "uninstalling ${PROJECT_NAME}"

Expand Down

0 comments on commit 7c27367

Please sign in to comment.