m/cup
1
0
mirror of https://github.com/sergi0g/cup.git synced 2025-11-13 23:53:48 -05:00

fix: strip hash when parsing image references

This commit is contained in:
Sergio
2025-03-07 17:37:56 +02:00
parent 0b0028ab6d
commit ddabd8c102

View File

@@ -16,7 +16,7 @@ pub fn split(reference: &str) -> (String, String, String) {
}
}
};
let splits = repository_and_tag.split(':').collect::<Vec<&str>>();
let splits = repository_and_tag.split('@').next().unwrap().split(':').collect::<Vec<&str>>();
let (repository, tag) = match splits.len() {
1 | 2 => {
let repository_components = splits[0].split('/').collect::<Vec<&str>>();
@@ -38,7 +38,7 @@ pub fn split(reference: &str) -> (String, String, String) {
};
(repository, tag)
}
_ => unreachable!(),
_ => {dbg!(splits); panic!()},
};
(registry.to_string(), repository, tag.to_string())
}