Skip to content

Commit 1d1b602

Browse files
committed
Delete service keys after deploy
1 parent e81ff23 commit 1d1b602

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

multiapps-controller-core/src/main/java/org/cloudfoundry/multiapps/controller/core/model/SupportedParameters.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ public class SupportedParameters {
140140
public static final String NAME = "name";
141141
public static final String SERVICE_KEY_CONFIG = "config";
142142
public static final String SERVICE_KEY_NAME = "service-key-name";
143+
public static final String DELETE_SERVICE_KEY_AFTER_DEPLOYMENT = "delete-service-key-after-deployment";
143144
public static final String DEFAULT_CONTAINER_NAME = "default-container-name";
144145
public static final String DEFAULT_XS_APP_NAME = "default-xsappname";
145146
public static final String TYPE = "type";

multiapps-controller-process/src/main/java/org/cloudfoundry/multiapps/controller/process/steps/BuildCloudUndeployModelStep.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,15 @@ private void setComponentsToUndeploy(ProcessContext context, List<String> servic
188188
context.setVariable(Variables.SUBSCRIPTIONS_TO_DELETE, subscriptions);
189189
context.setVariable(Variables.SERVICES_TO_DELETE, services);
190190
context.setVariable(Variables.APPS_TO_UNDEPLOY, apps);
191-
context.setVariable(Variables.SERVICE_KEYS_TO_DELETE, serviceKeys);
191+
context.setVariable(Variables.SERVICE_KEYS_TO_DELETE, getServiceKeysToDelete(context, serviceKeys));
192192
context.setVariable(Variables.APPS_TO_BACKUP, appsToBackup);
193193
}
194194

195+
private List<DeployedMtaServiceKey> getServiceKeysToDelete(ProcessContext context, List<DeployedMtaServiceKey> serviceKeys) {
196+
List<DeployedMtaServiceKey> scheduledServiceKeysForDeletion = context.getVariable(Variables.SERVICE_KEYS_TO_DELETE);
197+
return ListUtils.union(scheduledServiceKeysForDeletion, serviceKeys);
198+
}
199+
195200
private List<String> computeServicesToDelete(ProcessContext context, List<DeployedMtaApplication> appsWithoutChange,
196201
List<DeployedMtaService> deployedMtaServices, Set<String> servicesForApplications,
197202
List<String> servicesForCurrentDeployment) {

0 commit comments

Comments
 (0)