@@ -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)
910ova_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
1713sudo mount -t nfs " $NFS_IP_ADDRESS :$NFS_SHARE " " $nfs_mount_point "
1814if [ $? -eq 0 ]; then
2218 exit 1
2319fi
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."
2823sudo wget -P " $nfs_mount_point " " $ova_file_url "
2924if [ $? -eq 0 ]; then
3025 echo " OVA file copied successfully to NFS share."
3530# Unmount the NFS share
3631sudo 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