Skip to content

Commit

Permalink
Adopt to the updated api-model
Browse files Browse the repository at this point in the history
See 3594851 (PR #562)
  • Loading branch information
gesellix committed Oct 3, 2023
1 parent 2e3c856 commit f831b2b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ class ManageContainerClient implements ManageContainer {
true,
true,
null,
null,
(execConfig.Tty ?: false) as Boolean,
null,
command,
Expand All @@ -276,7 +277,8 @@ class ManageContainerClient implements ManageContainer {
String execId = execCreateResult.content.id
ExecStartConfig execStartConfig = new ExecStartConfig(
(execConfig.Detach ?: false) as Boolean,
actualExecConfig.tty)
actualExecConfig.tty,
null)
startExec(execId, execStartConfig, callback, timeout)
return execCreateResult
}
Expand Down Expand Up @@ -333,14 +335,14 @@ class ManageContainerClient implements ManageContainer {
// def multiplexStreams = !inspectContainer(container).content.config.tty

client.containerApi.containerLogs(container,
actualQuery.follow as Boolean,
actualQuery.stdout as Boolean,
actualQuery.stderr as Boolean,
actualQuery.since as Integer,
actualQuery.until as Integer,
actualQuery.timestamps as Boolean,
actualQuery.tail as String,
callback, timeout.toMillis())
actualQuery.follow as Boolean,
actualQuery.stdout as Boolean,
actualQuery.stderr as Boolean,
actualQuery.since as Integer,
actualQuery.until as Integer,
actualQuery.timestamps as Boolean,
actualQuery.tail as String,
callback, timeout.toMillis())
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package de.gesellix.docker.client.volume;

import de.gesellix.docker.client.EngineResponseContent;
import de.gesellix.docker.remote.api.ClusterVolumeSpec;
import de.gesellix.docker.remote.api.EngineApiClient;
import de.gesellix.docker.remote.api.Volume;
import de.gesellix.docker.remote.api.VolumeCreateOptions;
Expand Down Expand Up @@ -72,7 +73,8 @@ public EngineResponseContent<Volume> createVolume(Map<String, Object> config) {
config == null ? null : (String) config.get("Name"),
config == null ? null : (String) config.get("Driver"),
config == null ? null : (Map) config.get("DriverOpts"),
config == null ? null : (Map) config.get("Labels")));
config == null ? null : (Map) config.get("Labels"),
config == null ? null : (ClusterVolumeSpec) config.get("ClusterVolumeSpec")));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class ManageContainerClientTest extends Specification {
given:
def execApi = Mock(ExecApi)
client.execApi >> execApi
def execStartConfig = new ExecStartConfig(true, false)
def execStartConfig = new ExecStartConfig(true, false, null)
def callback = Mock(StreamCallback)

when:
Expand Down Expand Up @@ -251,12 +251,12 @@ class ManageContainerClientTest extends Specification {
then:
1 * execApi.containerExec("container-id",
new ExecConfig(false, true, true,
null, false,
null, null, false,
null, ["command", "line"],
null, null, null)) >> idResponse
then:
1 * execApi.execStart("exec-id",
new ExecStartConfig(false, false),
new ExecStartConfig(false, false, null),
callback, 1000)
and:
exec.content == idResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class ManageVolumeClientTest extends Specification {
DriverOpts: [:]])

then:
1 * volumeApi.volumeCreate(new VolumeCreateOptions("my-fancy-volume", "local", [:], null)) >> volumeResponse
1 * volumeApi.volumeCreate(new VolumeCreateOptions("my-fancy-volume", "local", [:], null, null)) >> volumeResponse
volume.content == volumeResponse
}

Expand All @@ -88,7 +88,7 @@ class ManageVolumeClientTest extends Specification {
def volumeApi = Mock(VolumeApi)
client.volumeApi >> volumeApi
def volumeResponse = Mock(Volume)
def volumeConfig = new VolumeCreateOptions("my-volume", "local", [:], [:])
def volumeConfig = new VolumeCreateOptions("my-volume", "local", [:], [:], null)

when:
def volume = service.createVolume(volumeConfig)
Expand Down

0 comments on commit f831b2b

Please sign in to comment.