Author:
Hash:
Timestamp:
+23 -8 +/-1 browse
Kevin Schoon [me@kevinschoon.com]
e50e19674c75917ef21db1d1e45dd8651e7dbfe0
Fri, 15 May 2026 09:14:30 +0000 (3 weeks ago)
| 1 | diff --git a/ayllu-build/src/libpod.rs b/ayllu-build/src/libpod.rs |
| 2 | index a1cd647..e758060 100644 |
| 3 | --- a/ayllu-build/src/libpod.rs |
| 4 | +++ b/ayllu-build/src/libpod.rs |
| 5 | @@ -16,6 +16,8 @@ use tokio_util::codec::{BytesCodec, FramedRead}; |
| 6 | |
| 7 | use crate::{error::Error, libpod_executor::Context}; |
| 8 | |
| 9 | + const API_VERSION: &str = "v5.0.0"; |
| 10 | + |
| 11 | #[derive(Deserialize, Debug)] |
| 12 | pub struct ErrorMessage { |
| 13 | pub cause: String, |
| 14 | @@ -140,7 +142,10 @@ impl Request { |
| 15 | match self { |
| 16 | Request::Ping => client.get(Url::parse("http://_/libpod/_ping").unwrap()), |
| 17 | Request::CreateContainer(create) => client |
| 18 | - .post(Url::parse("http://_/v6.0.0/libpod/containers/create").unwrap()) |
| 19 | + .post( |
| 20 | + Url::parse(&format!("http://_/{API_VERSION}/libpod/containers/create")) |
| 21 | + .unwrap(), |
| 22 | + ) |
| 23 | .json(create), |
| 24 | Request::ContainerExists(exists) => client.get( |
| 25 | Url::parse(&format!( |
| 26 | @@ -151,14 +156,17 @@ impl Request { |
| 27 | ), |
| 28 | Request::StartContainer(start) => client.post( |
| 29 | Url::parse(&format!( |
| 30 | - "http://_/v6.0.0/libpod/containers/{}/start", |
| 31 | + "http://_/{API_VERSION}/libpod/containers/{}/start", |
| 32 | start.name |
| 33 | )) |
| 34 | .unwrap(), |
| 35 | ), |
| 36 | Request::CopyFiles(copy) => client.put( |
| 37 | Url::parse_with_params( |
| 38 | - &format!("http://_/v6.0.0/libpod/containers/{}/archive", copy.name), |
| 39 | + &format!( |
| 40 | + "http://_/{API_VERSION}/libpod/containers/{}/archive", |
| 41 | + copy.name |
| 42 | + ), |
| 43 | &[("path", copy.path.clone())], |
| 44 | ) |
| 45 | .unwrap(), |
| 46 | @@ -166,7 +174,7 @@ impl Request { |
| 47 | Request::CreateExec(create) => client |
| 48 | .post( |
| 49 | Url::parse(&format!( |
| 50 | - "http://_/v6.0.0/libpod/containers/{}/exec", |
| 51 | + "http://_/{API_VERSION}/libpod/containers/{}/exec", |
| 52 | create.name |
| 53 | )) |
| 54 | .unwrap(), |
| 55 | @@ -191,18 +199,25 @@ impl Request { |
| 56 | ]); |
| 57 | client |
| 58 | .post( |
| 59 | - Url::parse(&format!("http://_/v6.0.0/libpod/exec/{}/start", start.id)) |
| 60 | - .unwrap(), |
| 61 | + Url::parse(&format!( |
| 62 | + "http://_/{API_VERSION}/libpod/exec/{}/start", |
| 63 | + start.id |
| 64 | + )) |
| 65 | + .unwrap(), |
| 66 | ) |
| 67 | .headers(headers) |
| 68 | .json(&json!({"Detach": false})) |
| 69 | } |
| 70 | Request::InspectExec(inspect) => client.get( |
| 71 | - Url::parse(&format!("http://_/v6.0.0/libpod/exec/{}/json", inspect.id)).unwrap(), |
| 72 | + Url::parse(&format!( |
| 73 | + "http://_/{API_VERSION}/libpod/exec/{}/json", |
| 74 | + inspect.id |
| 75 | + )) |
| 76 | + .unwrap(), |
| 77 | ), |
| 78 | Request::HealthCheck(check) => client.get( |
| 79 | Url::parse(&format!( |
| 80 | - "http://_/v6.0.0/libpod/containers/{}/healthcheck", |
| 81 | + "http://_/{API_VERSION}/libpod/containers/{}/healthcheck", |
| 82 | check.name |
| 83 | )) |
| 84 | .unwrap(), |