mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-04 05:31:32 +00:00
feat: implement kernel / initrd oci image support (#103)
* feat: implement kernel / initrd oci image support * fix: implement image urls more faithfully
This commit is contained in:
@ -159,7 +159,9 @@ impl OciPackerCache {
|
||||
let image_name = packed.name.to_string();
|
||||
annotations.insert(ANNOTATION_IMAGE_NAME.to_string(), image_name);
|
||||
let image_ref = packed.name.reference.clone();
|
||||
annotations.insert(ANNOTATION_REF_NAME.to_string(), image_ref);
|
||||
if let Some(image_ref) = image_ref {
|
||||
annotations.insert(ANNOTATION_REF_NAME.to_string(), image_ref);
|
||||
}
|
||||
descriptor.set_annotations(Some(annotations));
|
||||
manifests.push(descriptor.clone());
|
||||
index.set_manifests(manifests);
|
||||
|
@ -61,6 +61,10 @@ impl OciPackerService {
|
||||
digest: &str,
|
||||
format: OciPackedFormat,
|
||||
) -> Result<Option<OciPackedImage>> {
|
||||
if digest.contains('/') || digest.contains('\\') || digest.contains("..") {
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
self.cache
|
||||
.recall(ImageName::parse("cached:latest")?, digest, format)
|
||||
.await
|
||||
|
Reference in New Issue
Block a user