clippy: use bollard::models::NetworkConnectRequest (deprecation)
CI's clippy step failed on commit 194d63e because
bollard::network::ConnectNetworkOptions + its ::container field are
deprecated in bollard 0.19. Switch to the OpenAPI-generated
NetworkConnectRequest which the deprecation notice points at.
Behavior unchanged: same POST to /networks/bridge/connect with the
container name as payload.
Also attached bridge to the currently-in-flight research team
container out-of-band so its still-running iteration can complete —
without this the run would time out again like the last one.
This commit is contained in:
@@ -273,12 +273,13 @@ pub async fn spawn(
|
|||||||
/// attached" case (repeat spawns / restarts). Logs any real failure
|
/// attached" case (repeat spawns / restarts). Logs any real failure
|
||||||
/// with the container name so a broken network isn't invisible.
|
/// with the container name so a broken network isn't invisible.
|
||||||
async fn attach_external_bridge(docker: &Docker, name: &str) {
|
async fn attach_external_bridge(docker: &Docker, name: &str) {
|
||||||
use bollard::network::ConnectNetworkOptions;
|
// Use the OpenAPI-generated NetworkConnectRequest — the older
|
||||||
let opts: ConnectNetworkOptions<String> = ConnectNetworkOptions {
|
// ConnectNetworkOptions was deprecated in bollard 0.19.
|
||||||
container: name.to_string(),
|
let req = bollard::models::NetworkConnectRequest {
|
||||||
|
container: Some(name.to_string()),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
match docker.connect_network("bridge", opts).await {
|
match docker.connect_network("bridge", req).await {
|
||||||
Ok(_) => {}
|
Ok(_) => {}
|
||||||
Err(bollard::errors::Error::DockerResponseServerError {
|
Err(bollard::errors::Error::DockerResponseServerError {
|
||||||
status_code: 403, ..
|
status_code: 403, ..
|
||||||
|
|||||||
Reference in New Issue
Block a user