Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ public class InspectContainerResponse {
@JsonProperty("HostsPath")
private String hostsPath;

/**
* @since {@link RemoteApiVersion#VERSION_1_17}
*/
@JsonProperty("LogPath")
private String logPath;
Copy link
Member

Choose a reason for hiding this comment

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

Since what api version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's present since I remember. Even in your test inspectContainerResponse_full.json there is LogPath element

Copy link
Member

Choose a reason for hiding this comment

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

Please try check whether it exist before 1.19 at least and place javadoc.

Copy link
Member

Choose a reason for hiding this comment

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

If it already exists in existing json samples, then extend deserialisation test case with 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.

LogPath was for sure in 1.18

Copy link
Member

Choose a reason for hiding this comment

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

Please place javadoc @since ~ >1.17


@JsonProperty("Id")
private String id;

Expand Down Expand Up @@ -168,6 +174,11 @@ public String getHostsPath() {
return hostsPath;
}

@CheckForNull
public String getLogPath() {
Copy link
Member

Choose a reason for hiding this comment

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

@CheckForNull

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I know it never produces null - it can return empty string

Copy link
Member

Choose a reason for hiding this comment

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

On docker versions where this field didn't exist before it would be null.

return logPath;
}

public String getName() {
return name;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import static com.github.dockerjava.test.serdes.JSONTestHelper.testRoundTrip;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.isEmptyString;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.core.IsNot.not;
Expand Down Expand Up @@ -51,6 +52,7 @@ public void roundTrip_full() throws IOException {
assertEquals(response.getVolumesRW()[1].getVolume().getPath(), "/bar/foo/myvol2");
assertFalse(response.getVolumesRW()[1].getAccessMode().toBoolean());
assertTrue(response.getVolumesRW()[0].getAccessMode().toBoolean());
assertThat(response.getLogPath(), is("/mnt/sda1/var/lib/docker/containers/469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1/469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1-json.log"));
}

@Test
Expand Down