File tree Expand file tree Collapse file tree
src/test/java/com/github/dockerjava/core/command Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3838import com .github .dockerjava .api .model .ExposedPort ;
3939import com .github .dockerjava .api .model .HostConfig ;
4040import com .github .dockerjava .api .model .Link ;
41+ import com .github .dockerjava .api .model .LogConfig ;
4142import com .github .dockerjava .api .model .Ports ;
4243import com .github .dockerjava .api .model .RestartPolicy ;
4344import com .github .dockerjava .api .model .Ulimit ;
@@ -534,4 +535,21 @@ public void createContainerWithLabels() throws DockerException {
534535 labels .put ("com.github.dockerjava.null" , "" );
535536 assertThat (inspectContainerResponse .getConfig ().getLabels (), is (equalTo (labels )));
536537 }
538+
539+ @ Test (groups = "ignoreInCircleCi" )
540+ public void createContainerWithLogConfig () throws DockerException {
541+
542+ LogConfig logConfig = new LogConfig ("none" , null );
543+ CreateContainerResponse container = dockerClient .createContainerCmd ("busybox" ).
544+ withLogConfig (logConfig ).exec ();
545+
546+ LOG .info ("Created container {}" , container .toString ());
547+
548+ assertThat (container .getId (), not (isEmptyString ()));
549+
550+ InspectContainerResponse inspectContainerResponse = dockerClient .inspectContainerCmd (container .getId ()).exec ();
551+
552+ // null becomes empty string
553+ assertEquals (inspectContainerResponse .getHostConfig ().getLogConfig ().type , logConfig .type );
554+ }
537555}
You can’t perform that action at this time.
0 commit comments