mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-25 06:52:13 +00:00
agent-ctl: Add stub for AddSwap API
Add a basic implementation for the `AddSwap` agent API call. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
parent
82de838e5f
commit
7e401952f8
@ -88,6 +88,11 @@ static AGENT_CMDS: &'static [AgentCmd] = &[
|
|||||||
st: ServiceType::Agent,
|
st: ServiceType::Agent,
|
||||||
fp: agent_cmd_sandbox_add_arp_neighbors,
|
fp: agent_cmd_sandbox_add_arp_neighbors,
|
||||||
},
|
},
|
||||||
|
AgentCmd {
|
||||||
|
name: "AddSwap",
|
||||||
|
st: ServiceType::Agent,
|
||||||
|
fp: agent_cmd_sandbox_add_swap,
|
||||||
|
},
|
||||||
AgentCmd {
|
AgentCmd {
|
||||||
name: "Check",
|
name: "Check",
|
||||||
st: ServiceType::Health,
|
st: ServiceType::Health,
|
||||||
@ -1992,3 +1997,29 @@ fn get_repeat_count(cmdline: &str) -> i64 {
|
|||||||
Err(_) => return default_repeat_count,
|
Err(_) => return default_repeat_count,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn agent_cmd_sandbox_add_swap(
|
||||||
|
ctx: &Context,
|
||||||
|
client: &AgentServiceClient,
|
||||||
|
_health: &HealthClient,
|
||||||
|
_options: &mut Options,
|
||||||
|
_args: &str,
|
||||||
|
) -> Result<()> {
|
||||||
|
let req = AddSwapRequest::default();
|
||||||
|
|
||||||
|
let ctx = clone_context(ctx);
|
||||||
|
|
||||||
|
debug!(sl!(), "sending request"; "request" => format!("{:?}", req));
|
||||||
|
|
||||||
|
let reply = client
|
||||||
|
.add_swap(ctx, &req)
|
||||||
|
.map_err(|e| anyhow!("{:?}", e).context(ERR_API_FAILED))?;
|
||||||
|
|
||||||
|
// FIXME: Implement 'AddSwap' fully.
|
||||||
|
eprintln!("FIXME: 'AddSwap' not fully implemented");
|
||||||
|
|
||||||
|
info!(sl!(), "response received";
|
||||||
|
"response" => format!("{:?}", reply));
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user