Skip to content

Commit f44616f

Browse files
jkubrynskiKostyaSha
authored andcommitted
Fix docker-java#682 - Add LogPath to docker inspect response (docker-java#683)
* Fix docker-java#682 - Add LogPath to docker inspect response * Fix docker-java#682 - Add LogPath to docker inspect response - fixes after code review * Fix docker-java#682 - Add LogPath to docker inspect response - add javadoc * Fix docker-java#682 - Add LogPath to docker inspect response - clean test assertion
1 parent c8ab23f commit f44616f

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ public class InspectContainerResponse {
5353
@JsonProperty("HostsPath")
5454
private String hostsPath;
5555

56+
/**
57+
* @since {@link RemoteApiVersion#VERSION_1_17}
58+
*/
59+
@JsonProperty("LogPath")
60+
private String logPath;
61+
5662
@JsonProperty("Id")
5763
private String id;
5864

@@ -168,6 +174,11 @@ public String getHostsPath() {
168174
return hostsPath;
169175
}
170176

177+
@CheckForNull
178+
public String getLogPath() {
179+
return logPath;
180+
}
181+
171182
public String getName() {
172183
return name;
173184
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import static com.github.dockerjava.test.serdes.JSONTestHelper.testRoundTrip;
2323
import static org.hamcrest.MatcherAssert.assertThat;
2424
import static org.hamcrest.Matchers.containsString;
25+
import static org.hamcrest.Matchers.is;
2526
import static org.hamcrest.Matchers.isEmptyString;
2627
import static org.hamcrest.Matchers.nullValue;
2728
import static org.hamcrest.core.IsNot.not;
@@ -51,6 +52,7 @@ public void roundTrip_full() throws IOException {
5152
assertEquals(response.getVolumesRW()[1].getVolume().getPath(), "/bar/foo/myvol2");
5253
assertFalse(response.getVolumesRW()[1].getAccessMode().toBoolean());
5354
assertTrue(response.getVolumesRW()[0].getAccessMode().toBoolean());
55+
assertThat(response.getLogPath(), is("/mnt/sda1/var/lib/docker/containers/469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1/469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1-json.log"));
5456
}
5557

5658
@Test

0 commit comments

Comments
 (0)