diff --git a/doc/changelog.md b/doc/changelog.md index 1984c4d2e..130498ba6 100644 --- a/doc/changelog.md +++ b/doc/changelog.md @@ -8,6 +8,7 @@ - Preserve leading whitespace in logs (#875) - Maven property interpolation in Dockerfiles (#877) - Allow parameters for the log prefix (#890) + - When removing a volume don't error if the volume does not exist (#788) - Fix warning when COPY and/or ADD with parameters are used (#884) * **0.22.1** (2017-08-28) diff --git a/samples/log/pom.xml b/samples/log/pom.xml new file mode 100644 index 000000000..eed510bf0 --- /dev/null +++ b/samples/log/pom.xml @@ -0,0 +1,56 @@ + + 4.0.0 + + + + io.fabric8 + dmp-log + 0.21-SNAPSHOT + + + + + io.fabric8 + docker-maven-plugin + 0.21.0 + + true + always + true + + + jetty1 + jetty + + + .*Server:main: Started @\d+ms.* + + + true + + + + jetty2 + jetty + + + .*Server:main: Started @\d+ms.* + + + true + + + + + + + + + diff --git a/src/main/java/io/fabric8/maven/docker/access/DockerAccess.java b/src/main/java/io/fabric8/maven/docker/access/DockerAccess.java index 5e1868a9c..cd4c88a2a 100644 --- a/src/main/java/io/fabric8/maven/docker/access/DockerAccess.java +++ b/src/main/java/io/fabric8/maven/docker/access/DockerAccess.java @@ -272,7 +272,7 @@ void copyArchive(String containerId, File archive, String targetPath) String createVolume(VolumeCreateConfig configuration) throws DockerAccessException; /** - * removes a volume + * Removes a volume. It is a no-op if the volume does not exist. * @param name volume name to remove * @throws DockerAccessException if the volume could not be removed */ diff --git a/src/main/java/io/fabric8/maven/docker/access/hc/DockerAccessWithHcClient.java b/src/main/java/io/fabric8/maven/docker/access/hc/DockerAccessWithHcClient.java index 43ae96572..960291d2c 100644 --- a/src/main/java/io/fabric8/maven/docker/access/hc/DockerAccessWithHcClient.java +++ b/src/main/java/io/fabric8/maven/docker/access/hc/DockerAccessWithHcClient.java @@ -524,7 +524,7 @@ public String createVolume(VolumeCreateConfig containerConfig) public void removeVolume(String name) throws DockerAccessException { try { String url = urlBuilder.removeVolume(name); - delegate.delete(url, HTTP_NO_CONTENT); + delegate.delete(url, HTTP_NO_CONTENT, HTTP_NOT_FOUND); } catch (IOException e) { throw new DockerAccessException(e, "Unable to remove volume [%s]", name); }