Skip to content

Commit 7e81a08

Browse files
authored
Revert "capz: use provider-agnostic bastion resolution (#520)" (#525)
This reverts commit 522fe9a.
1 parent 522fe9a commit 7e81a08

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

capz/run-capz-e2e.sh

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -264,22 +264,9 @@ create_cluster(){
264264
log "cluster creation complete"
265265
fi
266266

267-
log "wait for "${CLUSTER_NAME}" cluster to stabilize"
268-
timeout --foreground 300 bash -c "until kubectl get --raw /version --request-timeout 5s > /dev/null 2>&1; do sleep 3; done"
269-
270-
CLUSTER_JSON=$(kubectl get cluster "${CLUSTER_NAME}" -n default -o json || true)
271-
if [[ -z "${CLUSTER_JSON}" ]]; then
272-
log "ERROR: failed to get cluster "${CLUSTER_NAME}" in namespace default"
273-
exit 1
274-
fi
275-
BASTION_ADDRESS=$(echo "${CLUSTER_JSON}" | jq -r '.spec.controlPlaneEndpoint.host // empty')
276-
if [[ -z "${BASTION_ADDRESS}" ]]; then
277-
log "ERROR: bastion address lookup failed for cluster"
278-
echo "${CLUSTER_JSON}"
279-
exit 1
280-
fi
281267
# set the SSH bastion that can be used to SSH into nodes
282-
export KUBE_SSH_BASTION="${BASTION_ADDRESS}:22"
268+
KUBE_SSH_BASTION=$(kubectl get azurecluster -o json | jq '.items[0].spec.networkSpec.apiServerLB.frontendIPs[0].publicIP.dnsName' | tr -d \"):22
269+
export KUBE_SSH_BASTION
283270
KUBE_SSH_USER=capi
284271
export KUBE_SSH_USER
285272
log "bastion info: $KUBE_SSH_USER@$KUBE_SSH_BASTION"
@@ -295,7 +282,7 @@ create_cluster(){
295282
apply_workload_configuraiton(){
296283
log "wait for cluster to stabilize"
297284
timeout --foreground 300 bash -c "until kubectl get --raw /version --request-timeout 5s > /dev/null 2>&1; do sleep 3; done"
298-
285+
299286
log "installing calico"
300287
"$TOOLS_BIN_DIR"/helm repo add projectcalico https://docs.tigera.io/calico/charts
301288
kubectl create ns calico-system

0 commit comments

Comments
 (0)