mirror of https://github.com/k3s-io/k3s
Merge pull request #46609 from abhinavdahiya/fix_inconsistent_path_order_cni
Automatic merge from submit-queue (batch tested with PRs 46782, 46719, 46339, 46609, 46494) Fix inconsistency in finding cni binaries Fixes [#46476] Signed-off-by: Abhinav Dahiya <abhinav.dahiya@coreos.com> **What this PR does / why we need it**: This fixes the inconsistency in finding the appropriate cni binaries. Currently `lo` cniNetwork follows vendorCniDir > binDir whereas default for all others is binDir > vendorCniDir. This PR makes vendorCniDir > binDir as default behavior. **Why we need it**: Hypercube right now ships cni binaries in /opt/cni/bin. And to use latest version of calico you need to override kubelet's /opt/cni/bin from host which means all other cni plugins (flannel, loopback etc...) have to be mounted from host too. Keeping vendordir at higher order allows easy installation of newer versions of plugins.pull/6/head
commit
747b3b1b0c
|
@ -134,7 +134,7 @@ func getDefaultCNINetwork(pluginDir, binDir, vendorCNIDirPrefix string) (*cniNet
|
||||||
// Search for vendor-specific plugins as well as default plugins in the CNI codebase.
|
// Search for vendor-specific plugins as well as default plugins in the CNI codebase.
|
||||||
vendorDir := vendorCNIDir(vendorCNIDirPrefix, confType)
|
vendorDir := vendorCNIDir(vendorCNIDirPrefix, confType)
|
||||||
cninet := &libcni.CNIConfig{
|
cninet := &libcni.CNIConfig{
|
||||||
Path: []string{binDir, vendorDir},
|
Path: []string{vendorDir, binDir},
|
||||||
}
|
}
|
||||||
network := &cniNetwork{name: confList.Name, NetworkConfig: confList, CNIConfig: cninet}
|
network := &cniNetwork{name: confList.Name, NetworkConfig: confList, CNIConfig: cninet}
|
||||||
return network, nil
|
return network, nil
|
||||||
|
|
Loading…
Reference in New Issue