k8s: Make operator machine destruction graceful
Issue-ID: SECCOM-235
Change-Id: I9913d9a8f525b4b9582bf821008dd567258a719c
Signed-off-by: Pawel Wieczorek <p.wieczorek2@samsung.com>
diff --git a/test/security/k8s/vagrant/dublin/Vagrantfile b/test/security/k8s/vagrant/dublin/Vagrantfile
index ef4d42b..1489037 100644
--- a/test/security/k8s/vagrant/dublin/Vagrantfile
+++ b/test/security/k8s/vagrant/dublin/Vagrantfile
@@ -79,6 +79,7 @@
SCRIPT
$rke_up = "rke up"
+$rke_down = "rke remove --force"
Vagrant.configure('2') do |config|
all.each do |machine|
@@ -145,6 +146,10 @@
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