Repository navigation
Fix image load response parsing in the docker manager - #96
Merged
Merged
Conversation
ImagePush decoded only the first message of the docker ImageLoad response
and used its stream text as the image reference. When an image with the
same name:tag already exists, docker first sends "The image X already
exists, renaming the old one with ID ... to empty string" and only then
"Loaded image: X", so the warning was passed to ImageTag and the push
failed with "Error parsing reference". Without a target name the
reference was split with strings.SplitN and parts[1] was read unchecked,
which panics when the stream has no ':' (empty stream, or
"Loaded image ID: ..." for untagged images).
- Read all messages of the response and use the first "Loaded image: "
(or "Loaded image ID: ") line; ignore other messages.
- Return errors reported in the stream (errorDetail / error) as Internal.
- Return Internal if no loaded image is reported instead of panicking.
- Untagged images ("Loaded image ID: <id>"): tag the ID when a target name
is given, otherwise return InvalidArgument.
- Split name and tag at the last ':' that is not part of a registry
host:port; default the tag to "latest".
f-sommerauer
marked this pull request as ready for review
November 5, 2026 17:13
alshabib
approved these changes
Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ImagePush decoded only the first message of the docker ImageLoad response
and used its stream text as the image reference. When an image with the
same name:tag already exists, docker first sends "The image X already
exists, renaming the old one with ID ... to empty string" and only then
"Loaded image: X", so the warning was passed to ImageTag and the push
failed with "Error parsing reference". Without a target name the
reference was split with strings.SplitN and parts[1] was read unchecked,
which panics when the stream has no ':' (empty stream, or
"Loaded image ID: ..." for untagged images).
(or "Loaded image ID: ") line; ignore other messages.
is given, otherwise return InvalidArgument.
host:port; default the tag to "latest".