Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Commit

Permalink
Change exitCode from Integer to Long
Browse files Browse the repository at this point in the history
This is a continuation of spotify/docker-client#1053 as parts of docker-client
were still using exit code of Integer. This caused some uses to have inconsistent types.
  • Loading branch information
Vishal Bhavsar committed Aug 28, 2018
1 parent f4aee05 commit 1eb8e67
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
public abstract class ContainerExit {

@JsonProperty("StatusCode")
public abstract Integer statusCode();
public abstract Long statusCode();

@JsonCreator
public static ContainerExit create(@JsonProperty("StatusCode") final Integer statusCode) {
public static ContainerExit create(@JsonProperty("StatusCode") final Long statusCode) {
return new AutoValue_ContainerExit(statusCode);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public abstract static class HealthLog {
public abstract Date end();

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

@JsonProperty("Output")
public abstract String output();
Expand All @@ -112,7 +112,7 @@ public abstract static class HealthLog {
static HealthLog create(
@JsonProperty("Start") final Date start,
@JsonProperty("End") final Date end,
@JsonProperty("ExitCode") final Integer exitCode,
@JsonProperty("ExitCode") final Long exitCode,
@JsonProperty("Output") final String output) {
return new AutoValue_ContainerState_HealthLog(start, end, exitCode, output);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public abstract class ExecState {

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

@JsonProperty("ProcessConfig")
public abstract ProcessConfig processConfig();
Expand All @@ -71,7 +71,7 @@ public abstract class ExecState {
static ExecState create(
@JsonProperty("ID") final String id,
@JsonProperty("Running") final Boolean running,
@JsonProperty("ExitCode") final Integer exitCode,
@JsonProperty("ExitCode") final Long exitCode,
@JsonProperty("ProcessConfig") final ProcessConfig processConfig,
@JsonProperty("OpenStdin") final Boolean openStdin,
@JsonProperty("OpenStdout") final Boolean openStdout,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ public abstract class ContainerStatus {

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

@JsonCreator
static ContainerStatus create(
@JsonProperty("ContainerID") final String containerId,
@JsonProperty("PID") final Integer pid,
@JsonProperty("ExitCode") final Integer exitCode) {
@JsonProperty("ExitCode") final Long exitCode) {
return new AutoValue_ContainerStatus(containerId, pid, exitCode);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@
import com.spotify.docker.client.messages.swarm.Placement;
import com.spotify.docker.client.messages.swarm.PortConfig;
import com.spotify.docker.client.messages.swarm.PortConfig.PortConfigPublishMode;
import com.spotify.docker.client.messages.swarm.Preference;
import com.spotify.docker.client.messages.swarm.RaftConfig;
import com.spotify.docker.client.messages.swarm.ReplicatedService;
import com.spotify.docker.client.messages.swarm.ResourceRequirements;
Expand All @@ -216,7 +215,6 @@
import com.spotify.docker.client.messages.swarm.Service;
import com.spotify.docker.client.messages.swarm.ServiceMode;
import com.spotify.docker.client.messages.swarm.ServiceSpec;
import com.spotify.docker.client.messages.swarm.Spread;
import com.spotify.docker.client.messages.swarm.Swarm;
import com.spotify.docker.client.messages.swarm.SwarmInit;
import com.spotify.docker.client.messages.swarm.SwarmSpec;
Expand Down Expand Up @@ -3611,7 +3609,7 @@ public void testExecInspect() throws Exception {
assertThat(notStarted.id(), is(execId));
assertThat(notStarted.running(), is(false));
if (dockerApiVersionLessThan("1.22")) {
assertThat(notStarted.exitCode(), is(0));
assertThat(notStarted.exitCode(), is(0L));
} else {
assertThat(notStarted.exitCode(), nullValue());
}
Expand All @@ -3626,7 +3624,7 @@ public void testExecInspect() throws Exception {
final ExecState started = sut.execInspect(execId);
assertThat(started.id(), is(execId));
assertThat(started.running(), is(false));
assertThat(started.exitCode(), is(2));
assertThat(started.exitCode(), is(2L));
assertThat(started.openStdin(), is(true));
assertThat(started.openStderr(), is(true));
assertThat(started.openStdout(), is(true));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void testLoadFromRandomFixture() throws Exception {
ContainerState.HealthLog log = health.log().get(0);
assertThat(log.start(), is(new Date(1412236801547L)));
assertThat(log.end(), is(new Date(1412236802697L)));
assertThat(log.exitCode(), is(1));
assertThat(log.exitCode(), is(1L));
assertThat(log.output(), is("output"));
}

Expand Down

0 comments on commit 1eb8e67

Please sign in to comment.