This commit is contained in:
jarek committed 2026-01-22 16:23:26 +01:00
1 parent a3cc26d958
commit 86a06d9de0
32 files changed
+799 -522

No files matched your search

+11 -1
View File
@@ -4,7 +4,7 @@ import {
removeContainer,
getContainerLogs
} from '$lib/server/docker';
import { deleteAutoUpdateSchedule, getAutoUpdateSetting } from '$lib/server/db';
import { deleteAutoUpdateSchedule, getAutoUpdateSetting, removePendingContainerUpdate } from '$lib/server/db';
import { authorize } from '$lib/server/authorize';
import { auditContainer } from '$lib/server/audit';
import { unregisterSchedule } from '$lib/server/scheduler';
@@ -85,6 +85,16 @@ export const DELETE: RequestHandler = async (event) => {
// Don't fail the deletion if schedule cleanup fails
}
// Clean up pending container update if exists
try {
if (envIdNum) {
await removePendingContainerUpdate(envIdNum, params.id);
}
} catch (error) {
console.error('Failed to cleanup pending container update:', error);
// Don't fail the deletion if cleanup fails
}
return json({ success: true });
} catch (error) {
console.error('Error removing container:', error);
@@ -182,6 +182,22 @@ export const POST: RequestHandler = async (event) => {
continue;
}
// Skip digest-pinned images - they are explicitly locked to a specific version
if (isDigestBasedImage(imageName)) {
safeEnqueue({
type: 'progress',
containerId,
containerName,
step: 'skipped',
current: i + 1,
total: containerIds.length,
success: true,
message: `Skipping ${containerName} - image pinned to specific digest`
});
skippedCount++;
continue;
}
// Step 1: Pull latest image
safeEnqueue({
type: 'progress',
@@ -559,8 +575,18 @@ export const POST: RequestHandler = async (event) => {
: `Updated ${successCount} of ${containerIds.length} containers`
});
clearInterval(keepaliveInterval);
controller.close();
if (keepaliveInterval) {
clearInterval(keepaliveInterval);
}
if (!controllerClosed) {
try {
controller.close();
controllerClosed = true;
} catch {
// Controller already closed - ignore
controllerClosed = true;
}
}
},
cancel() {
controllerClosed = true;