mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-06 14:41:32 +00:00
controller: implement enhanced image name format support
This commit is contained in:
@ -6,6 +6,9 @@ use std::ops::DerefMut;
|
||||
use ureq::{Agent, Request, Response};
|
||||
use url::Url;
|
||||
|
||||
const MANIFEST_PICKER_PLATFORM: Os = Os::Linux;
|
||||
const MANIFEST_PICKER_ARCHITECTURE: Arch = Arch::Amd64;
|
||||
|
||||
pub struct RegistryClient {
|
||||
agent: Agent,
|
||||
url: Url,
|
||||
@ -86,7 +89,9 @@ impl RegistryClient {
|
||||
fn pick_manifest(&mut self, index: ImageIndex) -> Option<Descriptor> {
|
||||
for item in index.manifests() {
|
||||
if let Some(platform) = item.platform() {
|
||||
if *platform.os() == Os::Linux && *platform.architecture() == Arch::Amd64 {
|
||||
if *platform.os() == MANIFEST_PICKER_PLATFORM
|
||||
&& *platform.architecture() == MANIFEST_PICKER_ARCHITECTURE
|
||||
{
|
||||
return Some(item.clone());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user