-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove configuration files even if TF resources are already removed (#…
…192) * pkg/cluster: Remove terraform resource only if tf state exists Signed-off-by: Din Music <din.music@din-cloud.com> * scripts: Add cluster destroy script Signed-off-by: Din Music <din.music@din-cloud.com> * .github/workflows: Test cluster destroy Signed-off-by: Din Music <din.music@din-cloud.com> --------- Signed-off-by: Din Music <din.music@din-cloud.com>
- Loading branch information
Showing
4 changed files
with
43 additions
and
19 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
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,19 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
if [ "${1:-}" = "" ]; then | ||
echo "Usage: ${0} <cluster_name>" | ||
exit 1 | ||
fi | ||
|
||
CLUSTER="${1}" | ||
|
||
echo "==> DESTROY: Cluster ${CLUSTER}" | ||
kubitect destroy --cluster "${CLUSTER}" | ||
|
||
if [ -d "${HOME}/.kubitect/clusters/${CLUSTER}" ]; then | ||
echo "==> FAIL: Cluster directory still exists" | ||
exit 1 | ||
fi | ||
|
||
echo "==> PASS" |