Skip to content

Delete service keys after deploy #1610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ public class SupportedParameters {
public static final String NAME = "name";
public static final String SERVICE_KEY_CONFIG = "config";
public static final String SERVICE_KEY_NAME = "service-key-name";
public static final String DELETE_SERVICE_KEY_AFTER_DEPLOYMENT = "delete-service-key-after-deployment";
public static final String DEFAULT_CONTAINER_NAME = "default-container-name";
public static final String DEFAULT_XS_APP_NAME = "default-xsappname";
public static final String TYPE = "type";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,15 @@ private void setComponentsToUndeploy(ProcessContext context, List<String> servic
context.setVariable(Variables.SUBSCRIPTIONS_TO_DELETE, subscriptions);
context.setVariable(Variables.SERVICES_TO_DELETE, services);
context.setVariable(Variables.APPS_TO_UNDEPLOY, apps);
context.setVariable(Variables.SERVICE_KEYS_TO_DELETE, serviceKeys);
context.setVariable(Variables.SERVICE_KEYS_TO_DELETE, getServiceKeysToDelete(context, serviceKeys));
context.setVariable(Variables.APPS_TO_BACKUP, appsToBackup);
}

private List<DeployedMtaServiceKey> getServiceKeysToDelete(ProcessContext context, List<DeployedMtaServiceKey> serviceKeys) {
List<DeployedMtaServiceKey> scheduledServiceKeysForDeletion = context.getVariable(Variables.SERVICE_KEYS_TO_DELETE);
return ListUtils.union(scheduledServiceKeysForDeletion, serviceKeys);
}

private List<String> computeServicesToDelete(ProcessContext context, List<DeployedMtaApplication> appsWithoutChange,
List<DeployedMtaService> deployedMtaServices, Set<String> servicesForApplications,
List<String> servicesForCurrentDeployment) {
Expand Down