Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
introduce check for pvcs in the app
Browse files Browse the repository at this point in the history
  • Loading branch information
Heavybullets8 committed Aug 20, 2023
1 parent 0a87f57 commit f84800b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions functions/pvc/mount.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,15 @@ pvc_stop_selected_app() {
fi
}

pvc_check_for_pvc(){
if k3s kubectl get pvc -n "ix-$app" --no-headers | grep -q .; then
return 0
else
echo -e "${yellow}$app, does not contain any PVC's${reset}"
exit 1
fi
}

#shellcheck disable=SC2120
mount_app_func() {
local manual_selection=$1
Expand All @@ -138,6 +147,8 @@ mount_app_func() {
fi
fi

pvc_check_for_pvc

pvc_stop_selected_app "$app"
sleep 2

Expand Down

0 comments on commit f84800b

Please sign in to comment.