Skip to content

Commit 6a2110c

Browse files
author
Sean Fitts
committed
A few tweaks
Revert API version which was by accident Fix bug in logging filter Add extra check to test to avoid downstream issues
1 parent ffe3301 commit 6a2110c

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

src/main/java/com/github/dockerjava/client/SelectiveLoggingFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public class SelectiveLoggingFilter extends LoggingFilter {
2929
public ClientResponse handle(ClientRequest request) throws ClientHandlerException {
3030
// Unless the content type is in the list of those we want to ellide, then just have
3131
// our super-class handle things.
32-
MediaType contentType = (MediaType) request.getHeaders().getFirst(HttpHeaders.CONTENT_TYPE);
33-
if (SKIPPED_CONTENT.contains(contentType.toString())) {
32+
Object contentType = request.getHeaders().getFirst(HttpHeaders.CONTENT_TYPE);
33+
if (contentType != null && SKIPPED_CONTENT.contains(contentType.toString())) {
3434
// Skip logging this.
3535
//
3636
// N.B. -- I'd actually love to reproduce (or better yet just use) the logging code from

src/main/java/com/github/dockerjava/client/command/AbstrDockerCmd.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
package com.github.dockerjava.client.command;
22

3+
import org.slf4j.Logger;
4+
import org.slf4j.LoggerFactory;
5+
36
import com.google.common.base.Preconditions;
47
import com.sun.jersey.api.client.WebResource;
58

69
public abstract class AbstrDockerCmd<T extends AbstrDockerCmd<T, RES_T>, RES_T> implements DockerCmd<RES_T> {
10+
11+
private final static Logger LOGGER = LoggerFactory.getLogger(AbstrDockerCmd.class);
712

813
protected WebResource baseResource;
914

@@ -18,6 +23,7 @@ public T withBaseResource(WebResource baseResource) {
1823
@Override
1924
public RES_T exec() {
2025
Preconditions.checkNotNull(baseResource, "baseResource was not specified");
26+
LOGGER.debug("Cmd: {}", this);
2127
return impl();
2228
}
2329
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
docker.io.url=http://localhost:2375
2-
docker.io.version=1.12
2+
docker.io.version=1.11

src/test/java/com/github/dockerjava/client/command/BuildImageCmdTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ public void testNetCatDockerfileBuilder() throws DockerException,
198198
ImageInspectResponse imageInspectResponse = dockerClient
199199
.inspectImageCmd(imageId).exec();
200200
assertThat(imageInspectResponse, not(nullValue()));
201+
assertThat(imageInspectResponse.getId(), not(nullValue()));
201202
LOG.info("Image Inspect: {}", imageInspectResponse.toString());
202203
tmpImgs.add(imageInspectResponse.getId());
203204

0 commit comments

Comments
 (0)