-
Notifications
You must be signed in to change notification settings - Fork 789
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Replace 'storage' with 'hostpath-storage'
- Loading branch information
Showing
11 changed files
with
77 additions
and
43 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,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
source $SNAP/actions/common/utils.sh | ||
|
||
echo "Disabling hostpath storage." | ||
read -ra ARGUMENTS <<< "$1" | ||
|
||
declare -A map | ||
map[\$SNAP_COMMON]="$SNAP_COMMON" | ||
use_manifest storage delete "$(declare -p map)" | ||
sleep 5 | ||
echo "Storage removed." | ||
if [ ! -z "${ARGUMENTS[@]}" ] && [ "${ARGUMENTS[@]}" = "destroy-storage" ] | ||
then | ||
run_with_sudo rm -rf "$SNAP_COMMON/default-storage" | ||
echo "Storage space reclaimed." | ||
else | ||
read -p "Remove PVC storage at $SNAP_COMMON/default-storage ? (Y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1 | ||
run_with_sudo rm -rf "$SNAP_COMMON/default-storage" | ||
echo "Storage space reclaimed." | ||
fi |
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
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
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,28 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
source $SNAP/actions/common/utils.sh | ||
|
||
if [ -d "$SNAP_COMMON/default-storage" ] | ||
then | ||
echo "Hostpath storage is already enabled." | ||
exit 0 | ||
fi | ||
|
||
echo "Enabling default storage class." | ||
echo "WARNING: Hostpath storage is not suitable for production environments." | ||
echo "" | ||
run_with_sudo mkdir -p ${SNAP_COMMON}/default-storage | ||
|
||
declare -A map | ||
map[\$SNAP_COMMON]="$SNAP_COMMON" | ||
use_manifest storage apply "$(declare -p map)" | ||
echo "Storage will be available soon." | ||
|
||
if [ -e ${SNAP_DATA}/var/lock/clustered.lock ] | ||
then | ||
echo "" | ||
echo "WARNING: The storage class enabled does not persist volumes across nodes." | ||
echo "" | ||
fi |
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
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
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
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
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
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
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