Skip to content

Commit

Permalink
Merge #330
Browse files Browse the repository at this point in the history
330: Add missed args passthrough in the HTTP client r=thomaseizinger a=andrey-yantsen

Initially, I was trying to test if #271 was fixed after migrating to Bollard (and yes, it was!). I thought that the simplest way to test it is just run something like `docker run --rm ubuntu:latest bash -c 'sleep 10 && echo ready && sleep 10'`. It worked like a charm for the Cli client but started to fail as soon as I switched to the HTTP one. Long story short — #270 will be fixed with the changes in this PR, and #271 can already be closed.

You seem to just forget about the args when you were implementing the HTTP client :)

Fixes #270.

Co-authored-by: Andrey Yantsen <andrey@janzen.su>
  • Loading branch information
bors[bot] and andrey-yantsen authored Jan 19, 2022
2 parents 278af82 + 17a8234 commit 9659ab7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/clients/http.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
core::{env, logs::LogStreamAsync, ports::Ports, DockerAsync},
ContainerAsync, Image, RunnableImage,
ContainerAsync, Image, ImageArgs, RunnableImage,
};
use async_trait::async_trait;
use bollard::{
Expand Down Expand Up @@ -132,6 +132,15 @@ impl Http {
});
}

let args = image
.args()
.clone()
.into_iterator()
.collect::<Vec<String>>();
if !args.is_empty() {
config.cmd = Some(args);
}

// create the container with options
let create_result = self
.create_container(create_options.clone(), config.clone())
Expand Down

0 comments on commit 9659ab7

Please sign in to comment.