Skip to content

Commit e1cc403

Browse files
committed
Makefile: add debug output for create-workload-cluster
1 parent 15af32d commit e1cc403

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,12 @@ create-workload-cluster: $(ENVSUBST) $(KUBECTL) ## Create a workload cluster.
416416
# Get kubeconfig and store it locally.
417417
$(KUBECTL) get secret/$(CLUSTER_NAME)-kubeconfig -n default -o json | jq -r .data.value | base64 --decode > ./kubeconfig
418418
# TODO: Standardize timeouts across the Makefile and make them configurable based on the job.
419-
$(KUBECTL) -n default wait --for=condition=Ready --timeout=60m cluster "$(CLUSTER_NAME)"
419+
$(KUBECTL) -n default wait --for=condition=Ready --timeout=60m cluster "$(CLUSTER_NAME)" && RET=$$? || RET=$$?; \
420+
if [ "$$RET" -ne "0" ]; then \
421+
echo "Failed to wait for cluster to be ready"; \
422+
$(KUBECTL) -n default get cluster-api -o yaml > ${ARTIFACTS}/debug.yaml; \
423+
exit 1; \
424+
fi; \
420425

421426
# Set the namespace to `default` b/c when the service account is auto mounted, the namespace is changed to `test-pods`.
422427
$(KUBECTL) --kubeconfig=./kubeconfig config set-context --current --namespace="default"

0 commit comments

Comments
 (0)