-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1bf9fe3
commit f665163
Showing
1 changed file
with
33 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
set -eoa pipefail | ||
|
||
SCRIPT_DIR=$(dirname "$(readlink -f "$0")") | ||
PLATFORM_DIR="$SCRIPT_DIR/.platform" | ||
PLATFORM_CONFIG="$PLATFORM_DIR/.config" | ||
|
||
# check if the platform directory exists | ||
if [ -d "$PLATFORM_DIR" ]; then | ||
# source the configuration file | ||
source $PLATFORM_CONFIG | ||
else | ||
echo "The platform directory not found: $PLATFORM_DIR" | ||
echo "Please run the setup.sh script first, or check the 'Manual deletion' section in the setup.md for manual deletion of the platform." | ||
exit 1 | ||
fi | ||
|
||
# Delete the cluster | ||
kind delete cluster --name $CLUSTER_NAME | ||
|
||
if [ "$INSTALL_LOCAL_REGISTRY" = "true" ]; then | ||
# Delete the local Docker registry | ||
echo "Deleting the local Docker registry..." | ||
docker stop kind-registry | ||
docker rm kind-registry | ||
echo "Local Docker registry deleted." | ||
fi | ||
|
||
rm -rf "$PLATFORM_DIR" | ||
|
||
echo "The platform has been successfully uninstalled." | ||
exit 0 |