From 3836899a261f7935dbe42518bb30a165aeb597a9 Mon Sep 17 00:00:00 2001 From: Kaustuv Royburman Date: Thu, 30 Aug 2018 11:44:49 +0530 Subject: [PATCH] Prevent resource deletion in Live Lab The tempest utility that is configured here will take a snapshot. After the snapashot and test run it will delete any resources that are not in the snapshot. If a tenant creates a resource outside of the test run it will also be deleted. This is something which is not desirable in a live lab. This patch aims to provide control to the end-user to define how to perform the final cleanup. Change-Id: I1f7eb3ac5e9f9be08cb05a70bb1fb2d0f4b41382 --- tempest/templates/bin/_run-tests.sh.tpl | 4 ++++ tempest/values.yaml | 1 + 2 files changed, 5 insertions(+) diff --git a/tempest/templates/bin/_run-tests.sh.tpl b/tempest/templates/bin/_run-tests.sh.tpl index 11f91fa4d0..2b1da0a1c4 100644 --- a/tempest/templates/bin/_run-tests.sh.tpl +++ b/tempest/templates/bin/_run-tests.sh.tpl @@ -18,12 +18,16 @@ limitations under the License. set -ex +{{ if .Values.conf.cleanup.enabled }} tempest cleanup --init-saved-state if [ "true" == "{{- .Values.conf.cleanup.force -}}" ]; then trap "tempest cleanup; exit" 1 ERR fi +{{- end }} {{ .Values.conf.script }} +{{ if .Values.conf.cleanup.enabled }} tempest cleanup +{{- end }} diff --git a/tempest/values.yaml b/tempest/values.yaml index fd4b632edf..0ff3627c93 100644 --- a/tempest/values.yaml +++ b/tempest/values.yaml @@ -200,6 +200,7 @@ conf: api_v3: True cleanup: force: false + enabled: true pvc: enabled: true