Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): Fix e2e tests #2004

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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