Disabled heat stack cleanup in case of max permitted stacks reached
Change-Id: I91d7cb8a985f0799c3c9871412fee4caed4290e4
diff --git a/cicd-lab-pipeline.groovy b/cicd-lab-pipeline.groovy
index 6705f9b..e2e86b6 100644
--- a/cicd-lab-pipeline.groovy
+++ b/cicd-lab-pipeline.groovy
@@ -84,6 +84,7 @@
if (env.BUILD_USER_ID && !env.BUILD_USER_ID.equals("jenkins")) {
def existingStacks = openstack.getStacksForNameContains(openstackCloud, "${env.BUILD_USER_ID}-${JOB_NAME}", openstackEnv)
if(existingStacks.size() >= _MAX_PERMITTED_STACKS){
+ HEAT_STACK_DELETE = "false"
throw new Exception("You cannot create new stack, you already have ${_MAX_PERMITTED_STACKS} stacks of this type (${JOB_NAME}). \nStack names: ${existingStacks}")
}
}
diff --git a/lab-pipeline.groovy b/lab-pipeline.groovy
index c488210..499c615 100644
--- a/lab-pipeline.groovy
+++ b/lab-pipeline.groovy
@@ -97,6 +97,7 @@
if (env.BUILD_USER_ID && !env.BUILD_USER_ID.equals("jenkins")) {
def existingStacks = openstack.getStacksForNameContains(openstackCloud, "${env.BUILD_USER_ID}-${JOB_NAME}", openstackEnv)
if(existingStacks.size() >= _MAX_PERMITTED_STACKS){
+ HEAT_STACK_DELETE = "false"
throw new Exception("You cannot create new stack, you already have ${_MAX_PERMITTED_STACKS} stacks of this type (${JOB_NAME}). \nStack names: ${existingStacks}")
}
}