From 74dd8f1a94b82a66e078f1a7d6276785a0d68c70 Mon Sep 17 00:00:00 2001 From: Lucas Berger Date: Mon, 2 Feb 2026 21:21:57 -0500 Subject: [PATCH] fix(update): ensure image tag is specified to prevent pulling all tags When Config.Image has no tag (e.g., "nitnelave/lldap" instead of "nitnelave/lldap:latest"), Docker's API pulls ALL tags for that image. This caused massive downloads and rate limit hits. Now appends ":latest" if no tag or digest is present in the image name. Co-Authored-By: Claude Opus 4.5 --- n8n-workflow.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/n8n-workflow.json b/n8n-workflow.json index c0e0903..d56d431 100644 --- a/n8n-workflow.json +++ b/n8n-workflow.json @@ -1551,7 +1551,7 @@ }, { "parameters": { - "jsCode": "// Parse container inspect output and extract config\nconst stdout = $input.item.json.stdout;\nconst cmdData = $('Build Inspect Command').item.json;\nconst containerId = cmdData.containerId;\nconst containerName = cmdData.containerName;\nconst chatId = cmdData.chatId;\n\nlet inspect;\ntry {\n inspect = JSON.parse(stdout);\n} catch (e) {\n return {\n json: {\n error: true,\n chatId,\n text: `Failed to inspect ${containerName}: ${e.message}`\n }\n };\n}\n\nconst imageName = inspect.Config.Image;\nconst currentImageId = inspect.Image;\n\n// Extract version from labels if available\nconst labels = inspect.Config.Labels || {};\nconst currentVersion = labels['org.opencontainers.image.version']\n || labels['version']\n || currentImageId.substring(7, 19);\n\nreturn {\n json: {\n imageName,\n currentImageId,\n currentVersion,\n containerConfig: inspect.Config,\n hostConfig: inspect.HostConfig,\n networkSettings: inspect.NetworkSettings,\n containerName,\n containerId,\n chatId\n }\n};" + "jsCode": "// Parse container inspect output and extract config\nconst stdout = $input.item.json.stdout;\nconst cmdData = $('Build Inspect Command').item.json;\nconst containerId = cmdData.containerId;\nconst containerName = cmdData.containerName;\nconst chatId = cmdData.chatId;\n\nlet inspect;\ntry {\n inspect = JSON.parse(stdout);\n} catch (e) {\n return {\n json: {\n error: true,\n chatId,\n text: `Failed to inspect ${containerName}: ${e.message}`\n }\n };\n}\n\nlet imageName = inspect.Config.Image;\nconst currentImageId = inspect.Image;\n\n// CRITICAL: Ensure image has a tag, otherwise Docker pulls ALL tags!\n// If no tag specified, default to :latest\nif (imageName && !imageName.includes(':') && !imageName.includes('@')) {\n imageName = imageName + ':latest';\n}\n\n// Extract version from labels if available\nconst labels = inspect.Config.Labels || {};\nconst currentVersion = labels['org.opencontainers.image.version']\n || labels['version']\n || currentImageId.substring(7, 19);\n\nreturn {\n json: {\n imageName,\n currentImageId,\n currentVersion,\n containerConfig: inspect.Config,\n hostConfig: inspect.HostConfig,\n networkSettings: inspect.NetworkSettings,\n containerName,\n containerId,\n chatId\n }\n};" }, "id": "code-parse-container-config", "name": "Parse Container Config",