mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-31 16:36:38 +00:00
agent: image: Set image-rs auth config
If the agent-config has a value for `image_registry_auth`, Then pass this to the image-rs client and enable auth mode too Fixes: #8122 Signed-off-by: Magnus Kulke <magnuskulke@microsoft.com> Signed-off-by: stevenhorsman <steven@uk.ibm.com>
This commit is contained in:
committed by
Wainer dos Santos Moschetta
parent
265322990a
commit
7cc81ce867
@@ -54,9 +54,16 @@ pub struct ImageService {
|
|||||||
|
|
||||||
impl ImageService {
|
impl ImageService {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self {
|
let mut image_client = ImageClient::new(PathBuf::from(KATA_IMAGE_WORK_DIR));
|
||||||
image_client: ImageClient::new(PathBuf::from(KATA_IMAGE_WORK_DIR)),
|
#[cfg(feature = "guest-pull")]
|
||||||
|
if !AGENT_CONFIG.image_registry_auth.is_empty() {
|
||||||
|
let registry_auth = &AGENT_CONFIG.image_registry_auth;
|
||||||
|
debug!(sl(), "Set registry auth file {:?}", registry_auth);
|
||||||
|
image_client.config.file_paths.auth_file = registry_auth.clone();
|
||||||
|
image_client.config.auth = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Self { image_client }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// pause image is packaged in rootfs
|
/// pause image is packaged in rootfs
|
||||||
|
Reference in New Issue
Block a user