Expand description
Library to write CNI plugins.
- CNI information: on the cni.dev website.
- Tooling overview
- Tutorial
§Quick start
use cni_plugin::{Cni, logger};
logger::install(env!("CARGO_PKG_NAME"));
match Cni::load() {
Cni::Add { container_id, ifname, netns, path, config } => {}
Cni::Del { container_id, ifname, netns, path, config } => {}
Cni::Check { container_id, ifname, netns, path, config } => {}
Cni::Version(_) => unreachable!()
}
or:
use cni_plugin::{Cni, Inputs, logger};
logger::install(env!("CARGO_PKG_NAME"));
let Inputs {
command, container_id, ifname, netns, path, config
} = Cni::load().into_inputs().unwrap();
Modules§
- config
- Configuration structures.
- delegation
- Plugin delegation.
- error
- When CNI goes bad.
- ip_
range - The IpRange type and helpers for IP pools.
- logger
- The standard logger and utilities.
- macaddr
- MAC address (de)serialisation.
- reply
- Reply types and helpers.
Structs§
- Inputs
- An alternate representation of plugin inputs.