Skip to content

Commit 47d5423

Browse files
committed
fix kubectl wait for clusters to use v1beta1 for compatibility
1 parent e1cc403 commit 47d5423

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

Makefile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -416,12 +416,7 @@ 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)" && 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; \
419+
$(KUBECTL) -n default wait --for=condition=Ready --timeout=60m clusters.v1beta1.cluster.x-k8s.io "$(CLUSTER_NAME)"
425420

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

scripts/ci-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ if [[ ! "${CLUSTER_TEMPLATE}" =~ "aks" ]]; then
251251
install_addons
252252
fi
253253

254-
"${KUBECTL}" --kubeconfig "${REPO_ROOT}/${KIND_CLUSTER_NAME}.kubeconfig" wait -A --for=condition=Ready --timeout=10m -l "cluster.x-k8s.io/cluster-name=${CLUSTER_NAME}" machinedeployments,machinepools
254+
"${KUBECTL}" --kubeconfig "${REPO_ROOT}/${KIND_CLUSTER_NAME}.kubeconfig" wait -A --for=condition=Ready --timeout=10m -l "cluster.x-k8s.io/cluster-name=${CLUSTER_NAME}" machinepools.v1beta1.cluster.x-k8s.io,machinedeployments.v1beta1.cluster.x-k8s.io
255255

256256
echo "Cluster ${CLUSTER_NAME} created and fully operational"
257257

0 commit comments

Comments
 (0)