Skip to content

Fix for #670#680

Merged
KostyaSha merged 1 commit intodocker-java:masterfrom
tejksat:fixLoadImageFromTarFails
Aug 28, 2016
Merged

Fix for #670#680
KostyaSha merged 1 commit intodocker-java:masterfrom
tejksat:fixLoadImageFromTarFails

Conversation

@tejksat
Copy link
Contributor

@tejksat tejksat commented Aug 25, 2016

JSON decoding disabled when response body is not expected to be parsed as a JSON.


This change is Reviewable

@tejksat
Copy link
Contributor Author

tejksat commented Aug 25, 2016

It could be fixed with this check or it could be a new post() method of InvocationBuilder, f.e. without TypeReference parameter.

channel.pipeline().addLast(new JsonObjectDecoder());
channel.pipeline().addLast(jsonResponseHandler);

if (!Void.class.equals(typeReference.getType())) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe instanceof check?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather refractor and extract a specific method without JSON mapping. I'll do it in the nearest days.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So merge it or better wait?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KostyaSha done! Pls check.

@KostyaSha
Copy link
Member

hello world still fails on first run :E but seems loadimage test fixed.
LGTM

@tejksat tejksat force-pushed the fixLoadImageFromTarFails branch from 3b154a9 to 548b247 Compare August 27, 2016 21:25
JSON decoding disabled on /images/load command execution.
@tejksat tejksat force-pushed the fixLoadImageFromTarFails branch from 548b247 to cc8dbea Compare August 27, 2016 22:40
@KostyaSha
Copy link
Member

KostyaSha commented Aug 28, 2016

@tejksat mmm... maybe it could be combined with #664 ?
The problem is that for some arguments loadImage may return json and for some plain text.
Now we have only:

 public class LoadImageCmdExec extends AbstrSyncDockerCmdExec<LoadImageCmd, Void> implements
         LoadImageCmd.Exec {

But i tried to make #664 with JsonParsed content and broke current quiet call.

So probably we can offer 2 different callbacks for end-users so they can choose them self what to use for what mix of arguments?

@KostyaSha
Copy link
Member

Merging this as it fixes test for 1.12 engine

@KostyaSha KostyaSha added this to the 3.0.6 milestone Aug 28, 2016
@KostyaSha KostyaSha merged commit c8ab23f into docker-java:master Aug 28, 2016
@tejksat tejksat deleted the fixLoadImageFromTarFails branch September 12, 2016 13:12
panuse pushed a commit to TuKangTech/docker-java that referenced this pull request Aug 20, 2017
JSON decoding disabled on /images/load command execution.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants