Skip to content

Commit

Permalink
Merge pull request #2876 from shreddedbacon/deploytarget-cleanup-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
tobybellwood authored Oct 18, 2021
2 parents ea9ccc1 + 5e83ffa commit 89cb142
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 6 additions & 0 deletions services/api/src/resources/project/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ export const Helpers = (sqlClientPool: Pool) => {
'DELETE FROM `project_notification` WHERE `pid` = :id',
{ id }
);
// clean up deploytarget configurations
await query(
sqlClientPool,
'DELETE FROM `deploy_target_config` WHERE `project` = :id',
{ id }
);
await query(sqlClientPool, 'DELETE FROM `project` WHERE `id` = :id', {
id
});
Expand Down
9 changes: 0 additions & 9 deletions services/api/src/resources/project/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -540,15 +540,6 @@ export const deleteProject: ResolverFn = async (
);
}

// clean up deploytarget configurations for this project
try {
await query(sqlClientPool, 'DELETE FROM deploy_target_config WHERE project = :pid', {
pid
});
} catch (err) {
// Not allowed to stop execution.
}

// @TODO discuss if we want to delete projects in harbor or not
//const harborOperations = createHarborOperations(sqlClientPool);

Expand Down

0 comments on commit 89cb142

Please sign in to comment.