From f108d4cff4e88fb0af6f9812c6333c58004bccf4 Mon Sep 17 00:00:00 2001 From: Mathieu LAUDE Date: Mon, 26 Jan 2026 16:11:10 +0100 Subject: [PATCH] fix: avoid deleting new Application (and subresources) --- plugins/argocd/src/functions.ts | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/plugins/argocd/src/functions.ts b/plugins/argocd/src/functions.ts index 0c7357106..98d8a00d4 100644 --- a/plugins/argocd/src/functions.ts +++ b/plugins/argocd/src/functions.ts @@ -146,29 +146,6 @@ export const upsertProject: StepCall = async (payload) => { await removeInfraEnvValues(project, gitlabApi) - // then destroy what should not exist - // @ts-ignore - for (const application of applications) { - const appEnv = application.metadata.labels['dso/environment'] - const appRepo = application.metadata.labels['dso/repository'] - const env = project.environments.find(env => env.name === appEnv) - const repo = infraRepositories.find(repo => repo.internalRepoName === appRepo) - if (!env || !repo) { - console.log(`Application ${application.metadata.name} should not exists anymore`) - await customK8sApi.deleteNamespacedCustomObject('argoproj.io', 'v1alpha1', getConfig().namespace, 'applications', application.metadata.name) - } - } - - // @ts-ignore - for (const appProject of appProjects) { - const projectEnv = appProject.metadata.labels['dso/environment'] - const env = project.environments.find(env => env.name === projectEnv) - if (!env) { - console.log(`AppProject ${appProject.metadata.name} should not exists anymore`) - await customK8sApi.deleteNamespacedCustomObject('argoproj.io', 'v1alpha1', getConfig().namespace, 'appprojects', appProject.metadata.name) - } - } - return { status: { result: 'OK',