Skip to content

Commit 83811b6

Browse files
bkhizgiybennyz
authored andcommitted
Fix CI setup for OVA provider
Signed-off-by: Bella Khizgiyaev <bkhizgiy@redhat.com>
1 parent c0c9d01 commit 83811b6

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

cluster/providers/ova/setup.sh

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,10 @@ set -ex
55
[ -z "${NFS_IP_ADDRESS}" ] && { echo "Provider cannot be installed - NFS_IP_ADDRESS env required" ; return 2 ;}
66
[ -z "${NFS_SHARE}" ] && { echo "Provider cannot be installed - NFS_SHARE env required" ; return 2 ;}
77

8-
nfs_mount_point="/tmp/ova"
8+
# Create a temporary directory for the NFS mount point
9+
nfs_mount_point=$(mktemp -d)
910
ova_file_url="https://github.com/kubev2v/forkliftci/releases/download/v9.0/vm.ova"
1011

11-
# Check if the mount point exists, and if not, create it
12-
if [ ! -d "$nfs_mount_point" ]; then
13-
mkdir -p "$nfs_mount_point"
14-
fi
15-
1612
# Mount the NFS share and check if the mount was successful
1713
sudo mount -t nfs "$NFS_IP_ADDRESS:$NFS_SHARE" "$nfs_mount_point"
1814
if [ $? -eq 0 ]; then
@@ -22,9 +18,8 @@ else
2218
exit 1
2319
fi
2420

25-
26-
# Downloaded the file and check if the copy was successful
27-
echo "Starting to download OVA file."
21+
# Download the file and check if the copy was successful
22+
echo "The VM ova file download started."
2823
sudo wget -P "$nfs_mount_point" "$ova_file_url"
2924
if [ $? -eq 0 ]; then
3025
echo "OVA file copied successfully to NFS share."
@@ -35,5 +30,8 @@ fi
3530
# Unmount the NFS share
3631
sudo umount "$nfs_mount_point"
3732

38-
# deploy csi-driver-nfs
39-
cluster/providers/utils/deploy_csi_driver_nfs.sh "${NFS_IP_ADDRESS}" "${NFS_SHARE}"
33+
# Remove the temporary directory
34+
rm -rf "$nfs_mount_point"
35+
36+
# Deploy csi-driver-nfs
37+
kubectl get StorageClass nfs-csi 2>/dev/null || cluster/providers/utils/deploy_csi_driver_nfs.sh "${NFS_IP_ADDRESS}" "${NFS_SHARE}"

0 commit comments

Comments
 (0)