From f28d3459fbc21369282aadbe6175254a271863db Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Wed, 15 Apr 2026 13:26:48 +0200 Subject: [PATCH] fix(docker): only set `replaceString` if requested --- lib/modules/manager/dockerfile/extract.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/modules/manager/dockerfile/extract.ts b/lib/modules/manager/dockerfile/extract.ts index 500879885ad..9a5737ec0a2 100644 --- a/lib/modules/manager/dockerfile/extract.ts +++ b/lib/modules/manager/dockerfile/extract.ts @@ -181,16 +181,14 @@ export function getDep( for (const [name, value] of Object.entries(registryAliases ?? {})) { if (currentFrom.startsWith(`${name}/`)) { const depName = currentFrom.substring(name.length + 1); - const dep = { - ...getDep(`${value}/${depName}`, false), - replaceString: currentFrom, - }; + const dep = getDep(`${value}/${depName}`, false); // retain depName, not sure if condition is necessary if (dep.depName?.startsWith(value)) { dep.packageName = dep.depName; dep.depName = `${name}/${dep.depName.substring(value.length + 1)}`; } if (specifyReplaceString) { + dep.replaceString = currentFrom; dep.autoReplaceStringTemplate = getAutoReplaceTemplate(dep); } return dep;