Skip to content

Default CNI plugin path should include /opt/cni/bin

Description:

The Arch Linux CRI-O PKGBUILD changes the default CNI plugin directory from /opt/cni/bin to /usr/lib/cni/bin via this sed command:

sed -e 's|/opt/cni/bin/|/usr/lib/cni/|g' -i pkg/config/config_unix.go

This can cause CRI-O to miss plugins installed only in /opt/cni/bin, leading to errors like "failed to find plugin in path [/usr/lib/cni/]".

The ArchWiki suggests configuring both directories. A better default would be to include a drop-in config file in the package at /etc/crio/crio.conf.d/00-plugin-dirs.conf with:

[crio.network] plugin_dirs = ["/opt/cni/bin", "/usr/lib/cni/bin"]

This ensures CRI-O searches both paths by default.

Additional info:

Steps to reproduce:

  1. Install cri-o and a CNI plugin that installs only to /opt/cni/bin.
  2. Configure a CNI network in /etc/cni/net.d referencing the plugin.
  3. Start CRI-O and run a container using the network.
  4. Check CRI-O logs for plugin not found errors.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information