Skip to content

Commit

Permalink
update ibmz workflow hostedcluster's kubeocnfig to nested_kubeconfig (#…
Browse files Browse the repository at this point in the history
…45015)

* update hostedcluster's kubeocnfig to nested_kubeconfig

* add co available check
  • Loading branch information
heliubj18 authored Nov 13, 2023
1 parent fe67926 commit 0efd4d0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,4 @@ echo "$(date) ISO Download url is ready"

# Download hosted cluster kubeconfig
echo "$(date) Create hosted cluster kubeconfig"
${HYPERSHIFT_CLI_NAME} create kubeconfig --namespace=${HC_NS} --name=${HC_NAME} >${SHARED_DIR}/${HC_NAME}_kubeconfig
${HYPERSHIFT_CLI_NAME} create kubeconfig --namespace=${HC_NS} --name=${HC_NAME} >${SHARED_DIR}/nested_kubeconfig
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ else
fi

echo "Fetching the hosted cluster IP address for resolution"
hc_url=$(cat ${SHARED_DIR}/${HC_NAME}_kubeconfig | awk '/server/{print $2}' | cut -c 9- | cut -d ':' -f 1)
hc_url=$(cat ${SHARED_DIR}/nested_kubeconfig | awk '/server/{print $2}' | cut -c 9- | cut -d ':' -f 1)
hc_ip=$(dig +short $hc_url | head -1)

echo "Adding A records in the DNS zone $HC_NAME.$HYPERSHIFT_BASEDOMAIN to resolve the api URLs of hosted cluster to the hosted cluster IP."
Expand Down Expand Up @@ -285,5 +285,6 @@ echo "$(date) All the agents are attached as compute nodes to the hosted control

# Verifying the compute nodes status
echo "$(date) Checking the compute nodes in the hosted control plane"
oc get no --kubeconfig="${SHARED_DIR}/${HC_NAME}_kubeconfig"
echo "$(date) Successfully completed the e2e creation chain"
oc get no --kubeconfig="${SHARED_DIR}/nested_kubeconfig"
oc --kubeconfig="${SHARED_DIR}/nested_kubeconfig" wait --all=true co --for=condition=Available=True --timeout=30m
echo "$(date) Successfully completed the e2e creation chain"
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ chain:
commands: |-
set -x
echo "$(date) Checking for the cluster-operators status to be ready"
export KUBECONFIG=${SHARED_DIR}/${HC_NAME}_kubeconfig
export KUBECONFIG=${SHARED_DIR}/nested_kubeconfig
while true; do
count=$(oc get co --no-headers| awk '$3 != "True" {print $1}' | wc -l)
if [ "$count" -eq 0 ]
Expand Down

0 comments on commit 0efd4d0

Please sign in to comment.