From 9250effa8f951cc2647cc06240e83aa65f3ef8b7 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 3 Feb 2022 12:40:46 -0500 Subject: [PATCH] Add `COMMIT_META_CONTAINER_CMD` constant Today we hardcode `/bin/bash` in https://github.com/coreos/coreos-assembler/blob/2088d24884771093101d95f915c921505128ef76/src/cmd-build#L405 But that breaks the concept of a bidirectional bridge between container image and ostree commit because this little bit of knowledge is encoded at the buildsystem side. This metadata key is intended to be written into an ostree commit, and then we will use it automatically in `container encapsulate`. The "source of truth" for this key will hence be able live in the same place that's generating the ostree commit. The more "proper" place for this is probably alongside the other constants in the libostree core C code. But that's tedious and slow to release. And Rust is the future. And we've been slowly adding more "core ostree" functionality here. --- rust-bindings/rust/src/constants.rs | 3 +++ rust-bindings/rust/src/lib.rs | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 rust-bindings/rust/src/constants.rs diff --git a/rust-bindings/rust/src/constants.rs b/rust-bindings/rust/src/constants.rs new file mode 100644 index 00000000..6586e7b6 --- /dev/null +++ b/rust-bindings/rust/src/constants.rs @@ -0,0 +1,3 @@ +/// Metadata key corresponding to the Docker/OCI `CMD` verb. +/// +pub const COMMIT_META_CONTAINER_CMD: &str = "ostree.container-cmd"; diff --git a/rust-bindings/rust/src/lib.rs b/rust-bindings/rust/src/lib.rs index a1ba65e0..fece5206 100644 --- a/rust-bindings/rust/src/lib.rs +++ b/rust-bindings/rust/src/lib.rs @@ -38,6 +38,9 @@ pub use crate::core::*; mod sysroot; pub use crate::sysroot::*; +mod constants; +pub use constants::*; + #[cfg(any(feature = "v2018_6", feature = "dox"))] mod collection_ref; #[cfg(any(feature = "v2018_6", feature = "dox"))]