diff options
author | Matthias Beyer <matthias.beyer@atos.net> | 2021-06-09 15:01:05 +0200 |
---|---|---|
committer | Matthias Beyer <matthias.beyer@atos.net> | 2021-06-09 15:01:05 +0200 |
commit | d6a62d748de71dd7ae0fad8da4289113616cfb99 (patch) | |
tree | 257a878afe9bd6996bd6bd5e6d80879b7c6e1c8e | |
parent | 6798e208d134f11c753489cacbdb5661d5333207 (diff) |
Use constant for patch destination prefix
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
-rw-r--r-- | src/consts.rs | 2 | ||||
-rw-r--r-- | src/endpoint/configured.rs | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/consts.rs b/src/consts.rs index 5c6dbc4..08401eb 100644 --- a/src/consts.rs +++ b/src/consts.rs @@ -18,6 +18,8 @@ pub const INPUTS_DIR_PATH: &str = "/inputs"; pub const OUTPUTS_DIR_PATH: &str = "/outputs"; pub const OUTPUTS_DIR_NAME: &str = "outputs"; +pub const PATCH_DIR_PATH: &str = "/patches"; + /// The path where the script that is executed inside the container is copied to. pub const SCRIPT_PATH: &str = "/script"; diff --git a/src/endpoint/configured.rs b/src/endpoint/configured.rs index 8fdec64..aecb291 100644 --- a/src/endpoint/configured.rs +++ b/src/endpoint/configured.rs @@ -543,8 +543,8 @@ impl<'a> PreparedContainer<'a> { .patches() .iter() .map(|patch| async move { - let destination = PathBuf::from("/patches").join(patch); - trace!("Copying patch {} to container at /patches/{}", patch.display(), destination.display()); + let destination = PathBuf::from(crate::consts::PATCH_DIR_PATH).join(patch); + trace!("Copying patch {} to container at {}/{}", crate::consts::PATCH_DIR_PATH, patch.display(), destination.display()); let mut buf = vec![]; tokio::fs::OpenOptions::new() |