From 595116580615502e0a0e70a9e1b906c6c41477af Mon Sep 17 00:00:00 2001
From: Pawel Wieczorek
Date: Mon, 29 Jul 2019 11:47:26 +0200
Subject: k8s: Make operator machine destruction graceful
Issue-ID: SECCOM-235
Change-Id: I9913d9a8f525b4b9582bf821008dd567258a719c
Signed-off-by: Pawel Wieczorek
---
test/security/k8s/vagrant/dublin/Vagrantfile | 5 +++++
1 file changed, 5 insertions(+)
(limited to 'test')
diff --git a/test/security/k8s/vagrant/dublin/Vagrantfile b/test/security/k8s/vagrant/dublin/Vagrantfile
index ef4d42b14..148903773 100644
--- a/test/security/k8s/vagrant/dublin/Vagrantfile
+++ b/test/security/k8s/vagrant/dublin/Vagrantfile
@@ -79,6 +79,7 @@ $link_cluster_yml = <<-SCRIPT
SCRIPT
$rke_up = "rke up"
+$rke_down = "rke remove --force"
Vagrant.configure('2') do |config|
all.each do |machine|
@@ -145,6 +146,10 @@ Vagrant.configure('2') do |config|
config.vm.post_up_message = operation_post_msg
config.vm.provision "rke_up", type: :shell, run: "never", privileged: false, inline: $rke_up
+ config.trigger.before :destroy do |trigger|
+ trigger.warn = "Removing cluster"
+ trigger.run_remote = {privileged: false, inline: $rke_down}
+ end
end
end
end
--
cgit 1.2.3-korg