@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof ExecState) { ExecState that = (ExecState) o; return (this.id.equals(that.id())) && (this.running.equals(that.running())) && ((this.exitCode == null) ? (that.exitCode() == null) : this.exitCode.equals(that.exitCode())) && (this.processConfig.equals(that.processConfig())) && (this.openStdin.equals(that.openStdin())) && (this.openStdout.equals(that.openStdout())) && (this.openStderr.equals(that.openStderr())) && ((this.container == null) ? (that.container() == null) : this.container.equals(that.container())) && ((this.containerId == null) ? (that.containerId() == null) : this.containerId.equals(that.containerId())); } return false; }
final long exitCode = docker.execInspect(execId).exitCode(); if (exitCode != 0) { log.warn("exec healthcheck containerId={} cmd={} failed with exitCode={} output={}",
@Override public boolean check(final String containerId) { // Make sure we are on a docker version that supports exec health checks if (!compatibleDockerVersion(docker)) { throw new UnsupportedOperationException( "docker exec healthcheck is not supported on your docker version"); } try { final List<String> cmd = healthCheck.getCommand(); final String execId = docker.execCreate(containerId, cmd.toArray(new String[cmd.size()]), DockerClient.ExecParameter.STDOUT, DockerClient.ExecParameter.STDERR); final String output; try (LogStream stream = docker.execStart(execId)) { output = stream.readFully(); } final int exitCode = docker.execInspect(execId).exitCode(); if (exitCode != 0) { log.info("healthcheck failed with exit code {}. output {}", exitCode, output); return false; } return true; } catch (DockerException e) { return false; } catch (InterruptedException e) { Thread.currentThread().interrupt(); return false; } }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof ExecState) { ExecState that = (ExecState) o; return (this.id.equals(that.id())) && (this.running.equals(that.running())) && ((this.exitCode == null) ? (that.exitCode() == null) : this.exitCode.equals(that.exitCode())) && (this.processConfig.equals(that.processConfig())) && (this.openStdin.equals(that.openStdin())) && (this.openStdout.equals(that.openStdout())) && (this.openStderr.equals(that.openStderr())) && ((this.container == null) ? (that.container() == null) : this.container.equals(that.container())) && ((this.containerId == null) ? (that.containerId() == null) : this.containerId.equals(that.containerId())); } return false; }
if (state.exitCode() == 0) { LOG.debug("Couchbase cluster created"); } else {
if (state.exitCode() == 0) { LOG.debug("Couchbase cluster initialised"); } else {