Skip to content

Commit 03bcfbc

Browse files
committed
fix(toolchain): fix compat with deploying using podman
1 parent 3671810 commit 03bcfbc

File tree

1 file changed

+3
-2
lines changed
  • packages/toolchain/toolchain/src/util/docker

1 file changed

+3
-2
lines changed

packages/toolchain/toolchain/src/util/docker/archive.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ async fn archive_oci_bundle(
105105
cmd: Option<Vec<String>>,
106106
entrypoint: Option<Vec<String>>,
107107
env: Vec<String>,
108+
#[serde(default)]
108109
user: String,
109110
#[serde(default)]
110111
working_dir: String,
@@ -328,7 +329,7 @@ fn copy_container_to_rootfs(
328329
// us
329330
let old_path_bytes = entry.path_bytes().to_vec();
330331
let old_path = UnixPath::new(old_path_bytes.as_ref() as &[u8]);
331-
let old_path_relative = old_path.strip_prefix("/")?;
332+
let old_path_relative = old_path.strip_prefix("/").unwrap_or(&old_path);
332333
let new_path = root_path.join(old_path_relative);
333334
let new_path_std = new_path.try_as_ref().context(format!(
334335
"failed to convert unix path to os path: {new_path:?}"
@@ -372,7 +373,7 @@ fn copy_container_to_rootfs(
372373
let old_link = UnixPath::new(old_link.as_ref() as &[u8]);
373374

374375
if old_link.is_absolute() {
375-
let old_link_relative = old_link.strip_prefix("/")?;
376+
let old_link_relative = old_link.strip_prefix("/").unwrap_or(&old_link);
376377
let new_link = root_path.join(old_link_relative);
377378
let new_link_std = new_link.try_as_ref().context(format!(
378379
"failed to convert unix path to os path: {new_link:?}"

0 commit comments

Comments
 (0)