Skip to content
This repository has been archived by the owner on Mar 21, 2022. It is now read-only.

Change ContainerState.exitCode from Integer to Long #1053

Merged
merged 1 commit into from
Aug 22, 2018
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 8.12.0

Not released yet

- Make ContainerState.exitCode() return a Long instead of Integer ([1052][])

[1052]: https://github.com/spotify/docker-client/issues/1052

## 8.11.6

Released Jun 2, 2018
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</parent>

<artifactId>docker-client</artifactId>
<version>8.11.8-SNAPSHOT</version>
<version>8.12.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>docker-client</name>
<description>A docker client</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public abstract class ContainerState {
public abstract Integer pid();

@JsonProperty("ExitCode")
public abstract Integer exitCode();
public abstract Long exitCode();

@JsonProperty("StartedAt")
public abstract Date startedAt();
Expand All @@ -83,7 +83,7 @@ static ContainerState create(
@JsonProperty("Paused") final Boolean addr,
@JsonProperty("Restarting") final Boolean restarting,
@JsonProperty("Pid") final Integer pid,
@JsonProperty("ExitCode") final Integer exitCode,
@JsonProperty("ExitCode") final Long exitCode,
@JsonProperty("StartedAt") final Date startedAt,
@JsonProperty("FinishedAt") final Date finishedAt,
@JsonProperty("Error") final String error,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3134,7 +3134,7 @@ public void testVolumesFrom() throws Exception {

final ContainerInfo info = sut.inspectContainer(mountContainer);
assertThat(info.state().running(), is(false));
assertThat(info.state().exitCode(), is(0));
assertThat(info.state().exitCode(), is(0L));

final String logs;
try (LogStream stream = sut.logs(info.id(), stdout(), stderr())) {
Expand Down Expand Up @@ -3172,7 +3172,7 @@ public void testAttachContainer() throws Exception {
sut.waitContainer(volumeContainer);
final ContainerInfo info = sut.inspectContainer(volumeContainer);
assertThat(info.state().running(), is(false));
assertThat(info.state().exitCode(), is(0));
assertThat(info.state().exitCode(), is(0L));
}

@Test
Expand Down Expand Up @@ -3261,7 +3261,7 @@ public void testLogsNoStdOut() throws Exception {

final ContainerInfo info = sut.inspectContainer(container);
assertThat(info.state().running(), is(false));
assertThat(info.state().exitCode(), is(0));
assertThat(info.state().exitCode(), is(0L));

final String logs;
try (LogStream stream = sut.logs(info.id(), stdout(false), stderr())) {
Expand All @@ -3288,7 +3288,7 @@ public void testLogsNoStdErr() throws Exception {

final ContainerInfo info = sut.inspectContainer(container);
assertThat(info.state().running(), is(false));
assertThat(info.state().exitCode(), is(0));
assertThat(info.state().exitCode(), is(0L));

final String logs;
try (LogStream stream = sut.logs(info.id(), stdout(), stderr(false))) {
Expand All @@ -3314,7 +3314,7 @@ public void testLogsTimestamps() throws Exception {

final ContainerInfo info = sut.inspectContainer(container);
assertThat(info.state().running(), is(false));
assertThat(info.state().exitCode(), is(0));
assertThat(info.state().exitCode(), is(0L));

final String logs;
try (LogStream stream = sut.logs(info.id(), stdout(), stderr(), timestamps())) {
Expand Down Expand Up @@ -3343,7 +3343,7 @@ public void testLogsTail() throws Exception {

final ContainerInfo info = sut.inspectContainer(container);
assertThat(info.state().running(), is(false));
assertThat(info.state().exitCode(), is(0));
assertThat(info.state().exitCode(), is(0L));

final String logs;
try (LogStream stream = sut.logs(info.id(), stdout(), stderr(), tail(2))) {
Expand Down Expand Up @@ -3374,7 +3374,7 @@ public void testLogsSince() throws Exception {

final ContainerInfo info = sut.inspectContainer(container);
assertThat(info.state().running(), is(false));
assertThat(info.state().exitCode(), is(0));
assertThat(info.state().exitCode(), is(0L));

final String logs;
// Get logs since the current timestamp. This should return nothing.
Expand Down Expand Up @@ -3407,7 +3407,7 @@ public void testLogsTty() throws DockerException, InterruptedException {
sut.waitContainer(container);
final ContainerInfo info = sut.inspectContainer(container);
assertThat(info.state().running(), is(false));
assertThat(info.state().exitCode(), is(0));
assertThat(info.state().exitCode(), is(0L));
}

@Test(expected = ContainerNotFoundException.class)
Expand Down Expand Up @@ -5778,7 +5778,7 @@ private void verifyNoTimeoutContainer(final String volumeContainer, final String
final ContainerInfo info = sut.inspectContainer(volumeContainer);
assertThat(result.toString().contains("Finished"), is(true));
assertThat(info.state().running(), is(false));
assertThat(info.state().exitCode(), is(0));
assertThat(info.state().exitCode(), is(0L));
}

private List<String> containersToIds(final List<Container> containers) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void testLoadFromRandomFixture() throws Exception {
assertThat(containerState.paused(), is(false));
assertThat(containerState.restarting(), is(false));
assertThat(containerState.running(), is(true));
assertThat(containerState.exitCode(), is(0));
assertThat(containerState.exitCode(), is(0L));
assertThat(containerState.pid(), is(27629));
assertThat(containerState.startedAt(), is(new Date(1412236798929L)));
assertThat(containerState.finishedAt(), is(new Date(-62135769600000L)));
Expand Down