Skip to content

Commit aec32b6

Browse files
author
Marcus Linke
committed
Merge branch 'jrrickard-issue584't push origin master
2 parents 8415919 + fac1ba2 commit aec32b6

File tree

4 files changed

+137
-1
lines changed

4 files changed

+137
-1
lines changed

src/main/java/com/github/dockerjava/api/command/GraphData.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package com.github.dockerjava.api.command;
22

3+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
34
import com.fasterxml.jackson.annotation.JsonProperty;
5+
46
import org.apache.commons.lang.builder.EqualsBuilder;
57
import org.apache.commons.lang.builder.HashCodeBuilder;
68
import org.apache.commons.lang.builder.ToStringBuilder;
@@ -11,7 +13,12 @@
1113
* part of {@link GraphDriver}
1214
* @author Kanstantsin Shautsou
1315
*/
16+
@JsonIgnoreProperties(ignoreUnknown = true)
1417
public class GraphData {
18+
19+
@JsonProperty("RootDir")
20+
private String rootDir;
21+
1522
@JsonProperty("DeviceId")
1623
private String deviceId;
1724

@@ -21,6 +28,22 @@ public class GraphData {
2128
@JsonProperty("DeviceSize")
2229
private String deviceSize;
2330

31+
/**
32+
* @see #rootDir
33+
*/
34+
@CheckForNull
35+
public String getRootDir() {
36+
return rootDir;
37+
}
38+
39+
/**
40+
* @see #rootDir
41+
*/
42+
public GraphData withRootDir(String rootDir) {
43+
this.rootDir = rootDir;
44+
return this;
45+
}
46+
2447
/**
2548
* @see #deviceId
2649
*/

src/main/java/com/github/dockerjava/api/command/GraphDriver.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package com.github.dockerjava.api.command;
22

3+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
34
import com.fasterxml.jackson.annotation.JsonProperty;
5+
46
import org.apache.commons.lang.builder.EqualsBuilder;
57
import org.apache.commons.lang.builder.HashCodeBuilder;
68
import org.apache.commons.lang.builder.ToStringBuilder;
@@ -13,6 +15,7 @@
1315
* @author Kanstantsin Shautsou
1416
* @since {@link com.github.dockerjava.core.RemoteApiVersion#VERSION_1_21}
1517
*/
18+
@JsonIgnoreProperties(ignoreUnknown = true)
1619
public class GraphDriver {
1720
/**
1821
* @since {@link com.github.dockerjava.core.RemoteApiVersion#VERSION_1_21}

src/test/java/com/github/dockerjava/api/command/InspectImageResponseTest.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,4 +189,21 @@ public void serder1_22_inspect_doc() throws IOException {
189189
assertThat(data.getDeviceSize(),
190190
is("171798691840"));
191191
}
192-
}
192+
193+
@Test
194+
private void testOverlayNetworkRootDir() throws IOException {
195+
final ObjectMapper mapper = new ObjectMapper();
196+
final JavaType type = mapper.getTypeFactory().constructType(InspectImageResponse.class);
197+
198+
final InspectImageResponse inspectImage = testRoundTrip(VERSION_1_22, "images/overlay/inspectOverlay.json", type);
199+
200+
final GraphData overlayGraphData = new GraphData()
201+
.withRootDir("/var/lib/docker/overlay/7e8d362d6b78d47eafe4863fd129cbcada35dbd419d7188cc1dbf1233d505576/root");
202+
final GraphDriver overlayGraphDriver = new GraphDriver().withName("overlay").withData(overlayGraphData);
203+
final GraphDriver graphDriver = inspectImage.getGraphDriver();
204+
assertThat(graphDriver, notNullValue());
205+
assertThat(graphDriver, equalTo(overlayGraphDriver));
206+
assertThat(graphDriver.getName(), is("overlay"));
207+
assertThat(graphDriver.getData(), equalTo(overlayGraphData));
208+
}
209+
}
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{
2+
"Id": "sha256:0ac989a7cba2ce7f5fbe5d520b338e780055ec251371ee35f7462ae9944696c5",
3+
"RepoTags": [
4+
"test-image:latest"
5+
],
6+
"RepoDigests": [],
7+
"Parent": "",
8+
"Comment": "",
9+
"Created": "2016-05-24T19:25:01.31608131Z",
10+
"Container": "221f000eccdec85b74cd4f4f37c7c0392d0f620bee45e9618cac3e57409a6d2c",
11+
"ContainerConfig": {
12+
"Hostname": "6ea525e7ec5c",
13+
"Domainname": "",
14+
"User": "",
15+
"AttachStdin": false,
16+
"AttachStdout": false,
17+
"AttachStderr": false,
18+
"Tty": false,
19+
"OpenStdin": false,
20+
"StdinOnce": false,
21+
"Env": [
22+
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
23+
],
24+
"Cmd": [
25+
"/bin/sh",
26+
"-c",
27+
"#(nop) ENTRYPOINT [\"bin/run.sh\"]"
28+
],
29+
"Image": "sha256:f8321fac5b5484874c1c5c02719905ec815c8ad20c2bc66222cfde19cd0491b7",
30+
"Volumes": {
31+
"/var/lib/docker": {}
32+
},
33+
"WorkingDir": "/opt",
34+
"Entrypoint": [
35+
"bin/run.sh"
36+
],
37+
"OnBuild": [],
38+
"Labels": {}
39+
},
40+
"DockerVersion": "1.11.1",
41+
"Author": "",
42+
"Config": {
43+
"Hostname": "6ea525e7ec5c",
44+
"Domainname": "",
45+
"User": "",
46+
"AttachStdin": false,
47+
"AttachStdout": false,
48+
"AttachStderr": false,
49+
"Tty": false,
50+
"OpenStdin": false,
51+
"StdinOnce": false,
52+
"Env": [
53+
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
54+
],
55+
"Cmd": null,
56+
"Image": "sha256:f8321fac5b5484874c1c5c02719905ec815c8ad20c2bc66222cfde19cd0491b7",
57+
"Volumes": {
58+
"/var/lib/docker": {}
59+
},
60+
"WorkingDir": "/opt",
61+
"Entrypoint": [
62+
"bin/run.sh"
63+
],
64+
"OnBuild": [],
65+
"Labels": {}
66+
},
67+
"Architecture": "amd64",
68+
"Os": "linux",
69+
"Size": 345943268,
70+
"VirtualSize": 345943268,
71+
"GraphDriver": {
72+
"Name": "overlay",
73+
"Data": {
74+
"RootDir": "/var/lib/docker/overlay/7e8d362d6b78d47eafe4863fd129cbcada35dbd419d7188cc1dbf1233d505576/root"
75+
}
76+
},
77+
"RootFS": {
78+
"Type": "layers",
79+
"Layers": [
80+
"sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
81+
"sha256:bd8153423e4131205018c431283e0a08298b291838db9bc6c19620523f5a818c",
82+
"sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
83+
"sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
84+
"sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
85+
"sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
86+
"sha256:bb0716c3f5f5be1e5ee6912f7e9f44193898e0b3ed9031a0416f8ca262e89975",
87+
"sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
88+
"sha256:58845ae9bfa7659900a9b30abb2c96330eff09bfbc6521ea77937ba60f8cc131",
89+
"sha256:8c22161a61c24eb6f7aa130d45189354fd8dbe9467e5b2debf828908113eacb0",
90+
"sha256:0c0c9045d2542e7845a2bdd8ead0e0fb2722be2c07c5553838dd61ffe051d672"
91+
]
92+
}
93+
}

0 commit comments

Comments
 (0)