mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-26 15:32:30 +00:00
agent: Wait for network before init_image_service
Based on the guidance from @Xynnn007 in #10851 > The new version of image-rs will do attestation once ClientBuilder.build().await() is called, while the old version will do so lazily the first image pull request comes. Looks like it's called in rpc::start() in kata-agent, when I'm afraid the network hasn't been initialized yet. > I am not sure if the guest network is prepared after the DNS is configured (in create_sandbox), if so we can move (the init_image_service) right after that. Signed-off-by: stevenhorsman <steven@uk.ibm.com>
This commit is contained in:
parent
a13d5a3f04
commit
d28a512d29
@ -1294,6 +1294,9 @@ impl agent_ttrpc::AgentService for AgentService {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "guest-pull")]
|
||||
image::init_image_service().await.map_ttrpc_err(same)?;
|
||||
|
||||
Ok(Empty::new())
|
||||
}
|
||||
|
||||
@ -1748,9 +1751,6 @@ pub async fn start(
|
||||
let health_service = Box::new(HealthService {}) as Box<dyn health_ttrpc::Health + Send + Sync>;
|
||||
let hservice = health_ttrpc::create_health(Arc::new(health_service));
|
||||
|
||||
#[cfg(feature = "guest-pull")]
|
||||
image::init_image_service().await?;
|
||||
|
||||
let server = TtrpcServer::new()
|
||||
.bind(server_address)?
|
||||
.register_service(aservice)
|
||||
|
Loading…
Reference in New Issue
Block a user