message: Add lagoon_kubernetesRemove active system support in createRemoveTask
diff: @@ -534,6 +534,103 @@ async function createRemoveTask(removeData) {
  }
  break;
  + case 'lagoon_kubernetesRemove':
  + if (type === 'branch') {
  + switch (project.branches) {
  + case undefined:
  + case null:
  + logger.debug(
  + `projectName: ${projectName}, branchName: ${branchName}, no branches defined in active system, assuming we want all of them`,
  + );
  + return sendToLagoonTasks('remove-kubernetes', removeData);
  + case 'true':
  + logger.debug(
  + `projectName: ${projectName}, branchName: ${branchName}, all branches active, therefore deploying`,
  + );
  + return sendToLagoonTasks('remove-kubernetes', removeData);
  + case 'false':
  + logger.debug(
  + `projectName: ${projectName}, branchName: ${branchName}, branch deployments disabled`,
  + );
  + throw new NoNeedToRemoveBranch('Branch deployments disabled');
  + default: {
  + logger.debug(
  + `projectName: ${projectName}, branchName: ${branchName}, regex ${
  + project.branches
  + }, testing if it matches`,
  + );
  + const branchRegex = new RegExp(project.branches);
  + if (branchRegex.test(branchName)) {
  + logger.debug(
  + `projectName: ${projectName}, branchName: ${branchName}, regex ${
  + project.branches
  + } matched branchname, starting deploy`,
  + );
  + return sendToLagoonTasks('remove-kubernetes', removeData);
  + }
  + logger.debug(
  + `projectName: ${projectName}, branchName: ${branchName}, regex ${
  + project.branches
  + } did not match branchname, not deploying`,
  + );
  + throw new NoNeedToDeployBranch(
  + `configured regex '${
  + project.branches
  + }' does not match branchname '${branchName}'`,
  + );
  + }
  + }
  + } else if (type === 'pullrequest') {
  + switch (project.pullrequests) {
  + case undefined:
  + case null:
  + logger.debug(
  + `projectName: ${projectName}, pullrequest: ${branchName}, no pullrequest defined in active system, assuming we want all of them`,
  + );
  + return sendToLagoonTasks('remove-kubernetes', removeData);
  + case 'true':
  + logger.debug(
  + `projectName: ${projectName}, pullrequest: ${branchName}, all pullrequest active, therefore deploying`,
  + );
  + return sendToLagoonTasks('remove-kubernetes', removeData);
  + case 'false':
  + logger.debug(
  + `projectName: ${projectName}, pullrequest: ${branchName}, pullrequest deployments disabled`,
  + );
  + throw new NoNeedToDeployBranch('PullRequest deployments disabled');
  + default: {
  + logger.debug(
  + `projectName: ${projectName}, pullrequest: ${branchName}, regex ${
  + project.pullrequests
  + }, testing if it matches PR Title '${pullrequestTitle}'`,
  + );
  +
  + const branchRegex = new RegExp(project.pullrequests);
  + if (branchRegex.test(pullrequestTitle)) {
  + logger.debug(
  + `projectName: ${projectName}, pullrequest: ${branchName}, regex ${
  + project.pullrequests
  + } matched PR Title '${pullrequestTitle}', starting deploy`,
  + );
  + return sendToLagoonTasks('remove-kubernetes', removeData);
  + }
  + logger.debug(
  + `projectName: ${projectName}, branchName: ${branchName}, regex ${
  + project.pullrequests
  + } did not match PR Title, not removing`,
  + );
  + throw new NoNeedToDeployBranch(
  + `configured regex '${
  + project.pullrequests
  + }' does not match PR Title '${pullrequestTitle}'`,
  + );
  + }
  + }
  + } else if (type === 'promote') {
  + return sendToLagoonTasks('remove-kubernetes', removeData);
  + }
  + break;
  +
  default:
  throw new UnknownActiveSystem(
  `Unknown active system '${
  