Skip to content

Commit b7bcf50

Browse files
NathanFlurryMasterPtato
authored andcommitted
fix(toolchain): fix compat with deploying using podman
1 parent ba59d98 commit b7bcf50

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,
@@ -327,7 +328,7 @@ fn copy_container_to_rootfs(
327328
// us
328329
let old_path_bytes = header.path_bytes();
329330
let old_path = UnixPath::new(old_path_bytes.as_ref() as &[u8]);
330-
let old_path_relative = old_path.strip_prefix("/")?;
331+
let old_path_relative = old_path.strip_prefix("/").unwrap_or(&old_path);
331332
let new_path = root_path.join(old_path_relative);
332333
let new_path_std = new_path.try_as_ref().context(format!(
333334
"failed to convert unix path to os path: {new_path:?}"
@@ -371,7 +372,7 @@ fn copy_container_to_rootfs(
371372
let old_link = UnixPath::new(old_link.as_ref() as &[u8]);
372373

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

0 commit comments

Comments
 (0)