mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-05-02 05:34:46 +00:00
runtime-rs: return port on agent-url req
Add the server vport (1024) when requesting agent-url Fixes: #5213 Signed-off-by: Ji-Xinyou <jerryji0414@outlook.com>
This commit is contained in:
parent
805e80b2a2
commit
9c1ac3d457
@ -130,7 +130,11 @@ impl KataAgent {
|
|||||||
|
|
||||||
pub(crate) async fn agent_sock(&self) -> Result<String> {
|
pub(crate) async fn agent_sock(&self) -> Result<String> {
|
||||||
let inner = self.inner.read().await;
|
let inner = self.inner.read().await;
|
||||||
Ok(inner.socket_address.clone())
|
Ok(format!(
|
||||||
|
"{}:{}",
|
||||||
|
inner.socket_address.clone(),
|
||||||
|
inner.config.server_port
|
||||||
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) async fn agent_config(&self) -> AgentConfig {
|
pub(crate) async fn agent_config(&self) -> AgentConfig {
|
||||||
|
@ -15,7 +15,10 @@ use common::{
|
|||||||
};
|
};
|
||||||
use containerd_shim_protos::events::task::TaskOOM;
|
use containerd_shim_protos::events::task::TaskOOM;
|
||||||
use hypervisor::{dragonball::Dragonball, Hypervisor, HYPERVISOR_DRAGONBALL};
|
use hypervisor::{dragonball::Dragonball, Hypervisor, HYPERVISOR_DRAGONBALL};
|
||||||
use kata_types::config::TomlConfig;
|
use kata_types::config::{
|
||||||
|
default::{DEFAULT_AGENT_LOG_PORT, DEFAULT_AGENT_VSOCK_PORT},
|
||||||
|
TomlConfig,
|
||||||
|
};
|
||||||
use resource::{
|
use resource::{
|
||||||
manager::ManagerArgs,
|
manager::ManagerArgs,
|
||||||
network::{NetworkConfig, NetworkWithNetNsConfig},
|
network::{NetworkConfig, NetworkWithNetNsConfig},
|
||||||
@ -299,8 +302,8 @@ impl Persist for VirtSandbox {
|
|||||||
let agent = Arc::new(KataAgent::new(kata_types::config::Agent {
|
let agent = Arc::new(KataAgent::new(kata_types::config::Agent {
|
||||||
debug: true,
|
debug: true,
|
||||||
enable_tracing: false,
|
enable_tracing: false,
|
||||||
server_port: 1024,
|
server_port: DEFAULT_AGENT_VSOCK_PORT,
|
||||||
log_port: 1025,
|
log_port: DEFAULT_AGENT_LOG_PORT,
|
||||||
dial_timeout_ms: 10,
|
dial_timeout_ms: 10,
|
||||||
reconnect_timeout_ms: 3_000,
|
reconnect_timeout_ms: 3_000,
|
||||||
request_timeout_ms: 30_000,
|
request_timeout_ms: 30_000,
|
||||||
|
Loading…
Reference in New Issue
Block a user