Adding everything needed to cleanup script
This commit is contained in:
parent
995aa95e57
commit
e908ccdb9c
2 changed files with 4 additions and 3 deletions
|
|
@ -2,6 +2,10 @@
|
||||||
cluster_name="$1"
|
cluster_name="$1"
|
||||||
echo "Starting cleanup for cluster: $cluster_name"
|
echo "Starting cleanup for cluster: $cluster_name"
|
||||||
|
|
||||||
|
sudo --preserve-env=HOME talosctl cluster destroy \
|
||||||
|
--provisioner=qemu \
|
||||||
|
--name $cluster_name || true
|
||||||
|
|
||||||
sudo ifconfig bridge0 destroy || true
|
sudo ifconfig bridge0 destroy || true
|
||||||
|
|
||||||
# Remove kubeconfig entries
|
# Remove kubeconfig entries
|
||||||
|
|
|
||||||
|
|
@ -92,9 +92,6 @@ resource "null_resource" "talos_cluster" {
|
||||||
provisioner "local-exec" {
|
provisioner "local-exec" {
|
||||||
when = destroy
|
when = destroy
|
||||||
command = <<EOT
|
command = <<EOT
|
||||||
sudo --preserve-env=HOME talosctl cluster destroy \
|
|
||||||
--provisioner=qemu \
|
|
||||||
--name ${self.triggers.cluster_name}
|
|
||||||
|
|
||||||
# Call cleanup script
|
# Call cleanup script
|
||||||
chmod +x ${path.module}/cleanup.sh
|
chmod +x ${path.module}/cleanup.sh
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue