Skip to content

Commit

Permalink
kubevirt: Fix deploying kubevirt on git actions
Browse files Browse the repository at this point in the history
Signed-off-by: Or Shoval <[email protected]>
  • Loading branch information
oshoval committed Aug 6, 2024
1 parent 12e7034 commit 7e49301
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ main() {
cd ${TMP_PROJECT_PATH}
export KUBEVIRT_PROVIDER=external
export DEV_IMAGE_REGISTRY=localhost:5000
./hack/deploy-kubevirt.sh
./cluster/cert-manager-install.sh
deploy_cnao
deploy_cnao_cr
./hack/deploy-kubevirt.sh

cd ${TMP_COMPONENT_PATH}
echo "Run kubevirt-ipam-controller functional tests"
Expand Down
15 changes: 14 additions & 1 deletion hack/deploy-kubevirt.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#!/bin/bash
set -exo pipefail

if [ "$GITHUB_ACTIONS" == "true" ]; then
for node in $(./cluster/kubectl.sh get node --no-headers -o custom-columns=":metadata.name"); do
docker exec -t $node bash -c "echo 'fs.inotify.max_user_watches=1048576' >> /etc/sysctl.conf"
docker exec -t $node bash -c "echo 'fs.inotify.max_user_instances=512' >> /etc/sysctl.conf"
docker exec -i $node bash -c "sysctl -p /etc/sysctl.conf"
done
fi

if [ -z "${KUBEVIRT_VERSION}" ];then
# Get latest stable KubeVirt version
export KUBEVIRT_VERSION=$(curl -s https://api.github.com/repos/kubevirt/kubevirt/releases | grep tag_name | grep -v -- - | sort -V | tail -1 | awk -F':' '{print $2}' | sed 's/,//' | xargs)
Expand All @@ -26,6 +34,11 @@ until ./cluster/kubectl.sh -n kubevirt get kv kubevirt; do
sleep 1
done

./cluster/kubectl.sh wait -n kubevirt kv kubevirt --for condition=Available --timeout 360s || (echo "KubeVirt not ready in time" && exit 1)
count=0
until ./cluster/kubectl.sh wait -n kubevirt kv kubevirt --for condition=Available --timeout 30s; do
((count++)) && ((count == 12)) && echo "KubeVirt is not ready" && exit 1
echo "waiting for KubeVirt to be ready"
sleep 1
done

echo "basename -- $0 done"

0 comments on commit 7e49301

Please sign in to comment.