Commit f594a7f
committed
cli/command/image: remove uses of JSON field
The JSON field was added in [moby@9fd2c0f], to address [moby#19177], which
reported an incompatibility with Classic (V1) Swarm, which produced a non-
standard response;
> Make docker load to output json when the response content type is json
> Swarm hijacks the response from docker load and returns JSON rather
> than plain text like the Engine does. This makes the API library to return
> information to figure that out.
A later change in [moby@96d7db6] added additional logic to make sure the
correct content-type was returned, depending on whether the `quiet` option
was set (which produced a non-JSON response). This caused inconsistency in
the API response, and [moby@2f27632] changed the endpoint to always produce
JSON (only skipping the "progress" output if `quiet` was set).
This means that the "load" endpoint ([`imageRouter.postImagesLoad`]) now
unconditionally returns JSON, making the `JSON` field fully redundant.
This patch removes the use of the JSON field, as it's redundant, and the way it handles
the content-type is incorrect because it would not handle correct, but different
formatted response-headers (`application/json; charset=utf-8`), which could
result in malformed output on the client.
[moby@9fd2c0f]: moby/moby@9fd2c0f
[moby#19177]: moby/moby#19177
[moby@96d7db6]: moby/moby@96d7db6
[moby@2f27632]: moby/moby@2f27632
[`imageRouter.postImagesLoad`]: https://github.com/moby/moby/blob/7b9d2ef6e5518a3d3f3cc418459f8df786cfbbd1/api/server/router/image/image_routes.go#L248-L255
Signed-off-by: Sebastiaan van Stijn <[email protected]>1 parent dafbfc2 commit f594a7f
File tree
8 files changed
+20
-36
lines changed- cli/command/image
- testdata
8 files changed
+20
-36
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
| 100 | + | |
106 | 101 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
78 | | - | |
| 77 | + | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | 97 | | |
107 | 98 | | |
108 | 99 | | |
109 | | - | |
110 | | - | |
| 100 | + | |
111 | 101 | | |
112 | | - | |
| 102 | + | |
113 | 103 | | |
114 | 104 | | |
115 | 105 | | |
116 | 106 | | |
117 | 107 | | |
118 | 108 | | |
119 | 109 | | |
120 | | - | |
121 | | - | |
| 110 | + | |
| 111 | + | |
122 | 112 | | |
123 | 113 | | |
124 | 114 | | |
| |||
129 | 119 | | |
130 | 120 | | |
131 | 121 | | |
132 | | - | |
133 | | - | |
| 122 | + | |
| 123 | + | |
134 | 124 | | |
135 | 125 | | |
136 | 126 | | |
| |||
139 | 129 | | |
140 | 130 | | |
141 | 131 | | |
142 | | - | |
143 | | - | |
| 132 | + | |
| 133 | + | |
144 | 134 | | |
145 | 135 | | |
146 | 136 | | |
| |||
149 | 139 | | |
150 | 140 | | |
151 | 141 | | |
152 | | - | |
153 | | - | |
| 142 | + | |
| 143 | + | |
154 | 144 | | |
155 | 145 | | |
156 | 146 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
0 commit comments