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:
- package version(s): 1.34.1-1
- config and/or log files: Default CRI-O config; logs show plugin not found errors.
- link to upstream bug report, if any: N/A (Arch-specific). See ArchWiki: https://wiki.archlinux.org/title/CRI-O#Plugin_directories and PKGBUILD: https://gitlab.archlinux.org/archlinux/packaging/packages/cri-o/-/blob/main/PKGBUILD?ref_type=heads#L70
Steps to reproduce:
- Install cri-o and a CNI plugin that installs only to /opt/cni/bin.
- Configure a CNI network in /etc/cni/net.d referencing the plugin.
- Start CRI-O and run a container using the network.
- Check CRI-O logs for plugin not found errors.