Repository navigation
Closed
Labels
Description
Part of #4839 (split from it in task TALE-176).
Problem
#4839 addendum 2, defect 5. Paths are under tools/cli/src/ unless noted.
| # | Defect | Code | What the operator sees |
|---|---|---|---|
| 5 | tale deploy --dry-run inspects the target image it hasn't pulled. On an install already at automation writer protocol 2, the dry-run branch admits the target image before anything is pulled. The real deploy only does this after its pull succeeds |
lib/actions/deploy.ts:373 if (rotatableToUpdate.length > 0 && installedProtocol === 2) and :374 serviceConfig.platformImage = await admitTagAutomationImage(. That runs docker image inspect on the target version's platform image: lib/deployment/tag-automation-protocol.ts:137 const reference = imageRef(config, 'platform'); and :147 await protocolRead(['image', 'inspect', reference], dependencies),. With no platformImage set (deploy.ts:308-311), imageRef resolves to the target version's tag (lib/compose/types.ts:251). protocolRead reports any failed read with one sentence and no cause (lib/deployment/automation-protocol.ts:67 if (!result.success) throw new Error('read refused');, then :69-72). The real deploy pulls first (deploy.ts:423) and admits only after that (:441-447) |
The documented upgrade preview stops with "The installed automation writer protocol could not be read safely." and exit code 5, whenever the target image isn't on the host yet. That is normal before an upgrade. The guide runs tale update --version <target-version> (docs/en/self-hosted/operate/upgrades.md:27), which leaves running containers alone (:30), then tale deploy --dry-run (:35). The sentence blames the installed protocol, not the missing target image |
Notes, all at 29e9445:
- The "Would pull" lines (
deploy.ts:401) come after the admission, so they are never printed when it throws. - Protocol-1 installs aren't affected. Their dry-run branch (
deploy.ts:378-399) never callsadmitTagAutomationImage; it only reports and warns.:379says why:// The target's protocol is known only once its image is pulled. - No test drives
deploy()withdryRun.lib/actions/rollback.test.ts, the onlydeploy()harness, always passesdryRun: false(for example:434). ThedryRun: truecases inlib/actions/deploy-preflight.test.ts(:148,:180) test onlyrunDeployPreflight. There is notag-automation-protocoltest file;admitTagAutomationImageis unit-tested inlib/deployment/automation-protocol.test.ts(:125).
Expected
- In a dry run, skip the image admission when the target image isn't local, and say what the real deploy would check after pulling. Alternatively, read the target's labels from the registry manifest.
- Name the image and the failed read in the error.
Regression: a deploy dry-run test on a protocol-2 install with the target image absent. Extend lib/actions/rollback.test.ts: it has the protocolFloor and targetProtocol switches (:54, :74) and the image inspect stub (:243-265). Run deploy() with dryRun: true, protocolFloor = 2 and the inspect failing. It must finish the preview and name the pending check. At 29e9445 it throws "The installed automation writer protocol could not be read safely." For the error text, extend the admitTagAutomationImage test in lib/deployment/automation-protocol.test.ts (:125) so that a failed inspect names the image.
Severity and owner
- Severity: medium (addendum 2): the preview step the upgrade guide prescribes fails for every protocol-2 upgrade, with a misleading cause.
- Owner: CLI (deploy, upgrades).
- Evidence: static reading at
train29e9445, same atfeature-train12625af; nothing was run. The cited paths are unchanged attrain1ae4a95 andfeature-train2334ceb. - Related: fix(cli): let tale deploy cross the automation protocol cutover #4954 (commit 009f64d) added the protocol-1 dry-run branch at
deploy.ts:378-399; the protocol-2 branch still inspects before any pull.
Activity
fix(cli): preview a protocol-2 upgrade before its image is pulled
fix(cli): preview a protocol-2 upgrade before its image is pulled