Casey Callendrello 72f2a1ffd4 plugins: correctly output build version, cosmetic cleanups
Now that libcni has the ability to print a version message, plumb it
through correctly.

While we're at it,
- fix import paths
- run gofmt
- add some more comments to sample
- add container runtime swappability for release
2019-04-15 16:52:07 +02:00
..
2019-01-30 01:51:57 +09:00

host-device

Move an already-existing device into a container.

This simple plugin will move the requested device from the host's network namespace to the container's. Nothing else will be done - no IPAM, no addresses.

The device can be specified with any one of three properties:

  • device: The device name, e.g. eth0, can0
  • hwaddr: A MAC address
  • kernelpath: The kernel device kobj, e.g. /sys/devices/pci0000:00/0000:00:1f.6

For this plugin, CNI_IFNAME will be ignored. Upon DEL, the device will be moved back.

A sample configuration might look like:

{
	"cniVersion": "0.3.1",
	"type": "host-device",
	"device": "enp0s1"
}