From 44b8812a7ba641f7c1980171c7714f6b4385160f Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 21 Feb 2023 13:08:14 +0100 Subject: [PATCH 1/5] debug --- apps/api/src/lib/services/handlers.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/api/src/lib/services/handlers.ts b/apps/api/src/lib/services/handlers.ts index 7f0d4505e..48a5dd85a 100644 --- a/apps/api/src/lib/services/handlers.ts +++ b/apps/api/src/lib/services/handlers.ts @@ -81,9 +81,9 @@ export async function startService(request: FastifyRequest, fa if (!arm && template.services[s]?.volumes?.length > 0) { template.services[s].volumes.forEach(v => volumes.add(v)) } - // Workaround: old plausible analytics service wrong volume id name if (service.type === 'plausibleanalytics' && service.plausibleAnalytics?.id) { + console.log('old plausible analytics service') let temp = Array.from(volumes) temp.forEach(a => { const t = a.replace(service.id, service.plausibleAnalytics.id) @@ -100,6 +100,7 @@ export async function startService(request: FastifyRequest, fa } } } + console.log(s, Array.from(volumes)) let ports = [] if (template.services[s].proxy?.length > 0) { for (const proxy of template.services[s].proxy) { From 906d181d1b6870d65d062ffb4cdc8bbca8e24cc8 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 21 Feb 2023 13:15:17 +0100 Subject: [PATCH 2/5] debug --- apps/api/src/lib/services/handlers.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/api/src/lib/services/handlers.ts b/apps/api/src/lib/services/handlers.ts index 48a5dd85a..aa41d9d98 100644 --- a/apps/api/src/lib/services/handlers.ts +++ b/apps/api/src/lib/services/handlers.ts @@ -75,10 +75,10 @@ export async function startService(request: FastifyRequest, fa } const customVolumes = await prisma.servicePersistentStorage.findMany({ where: { serviceId: id } }) let volumes = new Set() + console.log(template.services[s].volumes, arm) if (arm && template.services[s]?.volumesArm?.length > 0) { template.services[s].volumesArm.forEach(v => volumes.add(v)) - } - if (!arm && template.services[s]?.volumes?.length > 0) { + } else { template.services[s].volumes.forEach(v => volumes.add(v)) } // Workaround: old plausible analytics service wrong volume id name From d9362f09d89aef897247db272fbebda485963ede Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 21 Feb 2023 13:23:34 +0100 Subject: [PATCH 3/5] debug --- apps/api/src/lib/services/handlers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api/src/lib/services/handlers.ts b/apps/api/src/lib/services/handlers.ts index aa41d9d98..f159afdc0 100644 --- a/apps/api/src/lib/services/handlers.ts +++ b/apps/api/src/lib/services/handlers.ts @@ -75,7 +75,7 @@ export async function startService(request: FastifyRequest, fa } const customVolumes = await prisma.servicePersistentStorage.findMany({ where: { serviceId: id } }) let volumes = new Set() - console.log(template.services[s].volumes, arm) + console.log(template.services[s], arm) if (arm && template.services[s]?.volumesArm?.length > 0) { template.services[s].volumesArm.forEach(v => volumes.add(v)) } else { From 81f885311d180e03bcdaae95e17bdc0f3c1f07f0 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 21 Feb 2023 13:24:23 +0100 Subject: [PATCH 4/5] debug --- apps/api/src/lib/services/handlers.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/api/src/lib/services/handlers.ts b/apps/api/src/lib/services/handlers.ts index f159afdc0..c33501535 100644 --- a/apps/api/src/lib/services/handlers.ts +++ b/apps/api/src/lib/services/handlers.ts @@ -75,12 +75,15 @@ export async function startService(request: FastifyRequest, fa } const customVolumes = await prisma.servicePersistentStorage.findMany({ where: { serviceId: id } }) let volumes = new Set() - console.log(template.services[s], arm) + console.log(template.services[s].volumes) if (arm && template.services[s]?.volumesArm?.length > 0) { template.services[s].volumesArm.forEach(v => volumes.add(v)) } else { - template.services[s].volumes.forEach(v => volumes.add(v)) + if (template.services[s]?.volumes?.length > 0) { + template.services[s].volumes.forEach(v => volumes.add(v)) + } } + // Workaround: old plausible analytics service wrong volume id name if (service.type === 'plausibleanalytics' && service.plausibleAnalytics?.id) { console.log('old plausible analytics service') From 3ae1e7e87d31ca52d7d5c632549e9e6b9db907c5 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 21 Feb 2023 13:47:28 +0100 Subject: [PATCH 5/5] remove debug --- apps/api/src/lib/services/handlers.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/apps/api/src/lib/services/handlers.ts b/apps/api/src/lib/services/handlers.ts index c33501535..c0f33bd02 100644 --- a/apps/api/src/lib/services/handlers.ts +++ b/apps/api/src/lib/services/handlers.ts @@ -75,7 +75,6 @@ export async function startService(request: FastifyRequest, fa } const customVolumes = await prisma.servicePersistentStorage.findMany({ where: { serviceId: id } }) let volumes = new Set() - console.log(template.services[s].volumes) if (arm && template.services[s]?.volumesArm?.length > 0) { template.services[s].volumesArm.forEach(v => volumes.add(v)) } else { @@ -83,10 +82,8 @@ export async function startService(request: FastifyRequest, fa template.services[s].volumes.forEach(v => volumes.add(v)) } } - // Workaround: old plausible analytics service wrong volume id name if (service.type === 'plausibleanalytics' && service.plausibleAnalytics?.id) { - console.log('old plausible analytics service') let temp = Array.from(volumes) temp.forEach(a => { const t = a.replace(service.id, service.plausibleAnalytics.id) @@ -103,7 +100,6 @@ export async function startService(request: FastifyRequest, fa } } } - console.log(s, Array.from(volumes)) let ports = [] if (template.services[s].proxy?.length > 0) { for (const proxy of template.services[s].proxy) {