Skip to content

Update reimplements the shared Docker pull parser #6268

Backlog

Description

@thepastaclaw

PastaClaw flagged this while reviewing #4283, where it was deferred to a follow-up instead of being fixed in that pull request. This issue tracks the follow-up.

Update reimplements the shared Docker pull parser (suggestion)

Where: packages/dashmate/src/update/updateNodeFactory.js:34-51 at ac6de106458c:

return new Promise((resolve) => {
docker.pull(image, (err, stream) => {
if (err) {
// A registry response body can reach the operator's terminal
// through this message, so it is made safe to print
resolve({
name, title, image, updated: 'error', error: sanitizeRemoteText(err.message),
});
return;
}
// followProgress owns the stream: it joins messages split across
// chunks, splits them the way Docker writes them and reports
// transport failures. A failed pull arrives as a regular message
docker.modem.followProgress(stream, (streamError, output) => {
const error = sanitizeRemoteText(streamError?.message)
?? findPullStreamError(output);

This factory bypasses the newly centralized dockerPullFactory and duplicates docker.pull plus followProgress handling, while importing findPullStreamError directly. That leaves two owners for stream framing, transport-error handling, and pull-error extraction; future fixes to the Docker adapter will not apply to dashmate update. Inject the shared pull abstraction and convert its rejection into the per-image result, or expose a result-oriented adapter method while keeping Docker stream parsing in the Docker layer.

Origin

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions