fix: Properly handle alt-tags so they don't collide with default tags

This commit is contained in:
Gerald Pinder 2024-08-24 20:05:49 -04:00
parent 04972416cb
commit 9ed47c0884
4 changed files with 357 additions and 211 deletions

View file

@ -21,9 +21,17 @@ pub(crate) static RT: Lazy<Runtime> = Lazy::new(|| {
#[cfg(test)]
pub(crate) mod test {
use std::sync::LazyLock;
use blue_build_recipe::{Module, ModuleExt, Recipe};
use blue_build_utils::cowstr_vec;
use indexmap::IndexMap;
pub const TEST_TAG_1: &str = "test-tag-1";
pub const TEST_TAG_2: &str = "test-tag-2";
pub static TIMESTAMP: LazyLock<String> = LazyLock::new(blue_build_utils::get_tag_timestamp);
pub fn create_test_recipe() -> Recipe<'static> {
Recipe::builder()
.name("test")
@ -39,4 +47,21 @@ pub(crate) mod test {
.extra(IndexMap::new())
.build()
}
pub fn create_test_recipe_alt_tags() -> Recipe<'static> {
Recipe::builder()
.name("test")
.description("This is a test")
.base_image("base-image")
.image_version("40")
.alt_tags(cowstr_vec![TEST_TAG_1, TEST_TAG_2])
.modules_ext(
ModuleExt::builder()
.modules(vec![Module::builder().build()])
.build(),
)
.stages_ext(None)
.extra(IndexMap::new())
.build()
}
}