-
Notifications
You must be signed in to change notification settings - Fork 58
fix(dashmate): keep the node up when an image pull fails, and stop reporting success when it did not #4283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v4.2-dev
Are you sure you want to change the base?
fix(dashmate): keep the node up when an image pull fails, and stop reporting success when it did not #4283
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,23 +38,38 @@ export default class UpdateCommand extends ConfigBaseCommand { | |
| const colors = { | ||
| updated: chalk.yellow, | ||
| 'up to date': chalk.green, | ||
| 'built locally': chalk.gray, | ||
| error: chalk.red, | ||
| }; | ||
|
|
||
| // Draw table or show json | ||
| printArrayOfObjects(updateInfo | ||
| .reduce( | ||
| (acc, { | ||
| name, title, updated, image, | ||
| name, title, updated, image, error, | ||
| }) => ([ | ||
| ...acc, | ||
| format === OUTPUT_FORMATS.PLAIN | ||
| ? { Service: title, Image: image, Updated: colors[updated](updated) } | ||
| : { | ||
| name, title, updated, image, | ||
| name, title, updated, image, error, | ||
| }, | ||
| ]), | ||
| [], | ||
| ), format); | ||
|
|
||
| const failedServices = updateInfo.filter(({ updated }) => updated === 'error'); | ||
|
|
||
| if (failedServices.length > 0) { | ||
| const reasons = failedServices | ||
| .map(({ title, image, error }) => ` ${title} (${image}): ${error}`) | ||
| .join('\n'); | ||
|
|
||
| // Report to stderr to keep machine-readable output on stdout intact | ||
| // eslint-disable-next-line no-console | ||
| console.error(`\nFailed to update ${failedServices.length} of ${updateInfo.length} images:\n\n${reasons}\n`); | ||
|
Comment on lines
+64
to
+70
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Blocking: Sanitize registry error text before terminal output The source: ['codex'] |
||
|
|
||
| process.exitCode = 1; | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| /** | ||
| * Find a failure reported inside a Docker pull progress stream | ||
| * | ||
| * Docker answers a pull request with 200 and then reports registry and disk | ||
| * failures as a message in the progress stream, so a completed stream doesn't | ||
| * mean the image was pulled. | ||
| * | ||
| * @param {Object[]} output - messages collected from the pull stream | ||
| * @return {string|undefined} failure reason | ||
| */ | ||
| export default function findPullStreamError(output) { | ||
| const failure = output.find((message) => message?.error); | ||
|
|
||
| if (!failure) { | ||
| return undefined; | ||
| } | ||
|
|
||
| return failure.errorDetail?.message ?? failure.error; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 Blocking: Build local images before stopping group nodes
This pre-stop phase only calls
pullMissingImages, which intentionally excludes services markedisBuiltLocally. When local builds are enabled,startGroupNodesTaskrunsbuildServicesTaskas its first task, but that happens only after every node has been stopped. A missing local image or any build failure therefore still leaves the entire group down, despite the commit's stated guarantee that required images are prepared before anything stops. Run the shared local build before the stop phase and arrange for the subsequent group start to skip the duplicate build.source: ['codex']