-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Alexandre Lamarre <[email protected]>
- Loading branch information
1 parent
a5d3015
commit ca96f62
Showing
4 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set -e | ||
set -x | ||
|
||
k3d cluster delete ${CLUSTER_NAME} || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -x | ||
|
||
# waits until all nodes are ready | ||
wait_for_nodes(){ | ||
echo "wait until all agents are ready" | ||
while : | ||
do | ||
readyNodes=1 | ||
statusList=$(kubectl get nodes --no-headers | awk '{ print $2}') | ||
# shellcheck disable=SC2162 | ||
while read status | ||
do | ||
if [ "$status" == "NotReady" ] || [ "$status" == "" ] | ||
then | ||
readyNodes=0 | ||
break | ||
fi | ||
done <<< "$(echo -e "$statusList")" | ||
# all nodes are ready; exit | ||
if [[ $readyNodes == 1 ]] | ||
then | ||
break | ||
fi | ||
sleep 1 | ||
done | ||
} | ||
|
||
k3d cluster create ${CLUSTER_NAME} | ||
wait_for_nodes | ||
|
||
echo "${CLUSTER_NAME} ready" | ||
|
||
IMAGE=${REPO}/backup-restore-operator:${TAG} | ||
|
||
k3d import image ${IMAGE} -c ${CLUSTER_NAME} |