File: 0006-Add-Debian-specific-CNI-bin-dir-to-ctr-run-command.patch

package info (click to toggle)
containerd 1.7.24~ds1-8
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid
  • size: 15,164 kB
  • sloc: sh: 1,356; makefile: 582
file content (36 lines) | stat: -rw-r--r-- 1,377 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From: Shengjing Zhu <zhsj@debian.org>
Date: Tue, 1 Mar 2022 21:38:59 +0800
Subject: Add Debian specific CNI bin dir to ctr run command

Forwarded: not-needed
---
 cmd/ctr/commands/run/run.go   | 2 +-
 pkg/cri/config/config_unix.go | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmd/ctr/commands/run/run.go b/cmd/ctr/commands/run/run.go
index c6833ae..3f8d4e5 100644
--- a/cmd/ctr/commands/run/run.go
+++ b/cmd/ctr/commands/run/run.go
@@ -182,7 +182,7 @@ var Command = cli.Command{
 		}
 		var network gocni.CNI
 		if enableCNI {
-			if network, err = gocni.New(gocni.WithDefaultConf); err != nil {
+			if network, err = gocni.New(gocni.WithPluginDir([]string{gocni.DefaultCNIDir, "/usr/lib/cni"}), gocni.WithDefaultConf); err != nil {
 				return err
 			}
 		}
diff --git a/pkg/cri/config/config_unix.go b/pkg/cri/config/config_unix.go
index 4a79063..e992378 100644
--- a/pkg/cri/config/config_unix.go
+++ b/pkg/cri/config/config_unix.go
@@ -63,7 +63,7 @@ func DefaultConfig() PluginConfig {
 	tree, _ := toml.Load(defaultRuncV2Opts)
 	return PluginConfig{
 		CniConfig: CniConfig{
-			NetworkPluginBinDir:        "/opt/cni/bin",
+			NetworkPluginBinDir:        "/usr/lib/cni",
 			NetworkPluginConfDir:       "/etc/cni/net.d",
 			NetworkPluginMaxConfNum:    1, // only one CNI plugin config file will be loaded
 			NetworkPluginSetupSerially: false,