From 3ba04c01cc4a71e736fe1898f931398154d08cf3 Mon Sep 17 00:00:00 2001 From: Mike Brown Date: Tue, 11 Jun 2019 08:35:22 -0500 Subject: [PATCH] doc update for cni max num Signed-off-by: Mike Brown --- docs/config.md | 10 ++++++---- pkg/config/config.go | 6 ++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/config.md b/docs/config.md index 1629b8f1a..48dca59fb 100644 --- a/docs/config.md +++ b/docs/config.md @@ -149,10 +149,12 @@ The explanation and default value of each configuration item are as follows: # conf_dir is the directory in which the admin places a CNI conf. conf_dir = "/etc/cni/net.d" - # max_conf_num is the max number of CNI plugin config file will load - # By default, the containerd will load only 1 CRI plugin. If you want load multiple CRI plugins, - # set max_conf_num > 1. You should know exactly each CRI plugin do, whether they are compatible. - # max i<= 0 means no limit. + # max_conf_num specifies the maximum number of CNI plugin config files to + # load from the CNI config directory. By default, only 1 CNI plugin config + # file will be loaded. If you want to load multiple CNI plugin config files + # set max_conf_num to the number desired. Setting max_config_num to 0 is + # interpreted as no limit is desired and will result in all CNI plugin + # config files being loaded from the CNI config directory. max_conf_num = 1 # conf_template is the file path of golang template used to generate diff --git a/pkg/config/config.go b/pkg/config/config.go index 894951085..a6ff387cd 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -71,7 +71,9 @@ type CniConfig struct { NetworkPluginBinDir string `toml:"bin_dir" json:"binDir"` // NetworkPluginConfDir is the directory in which the admin places a CNI conf. NetworkPluginConfDir string `toml:"conf_dir" json:"confDir"` - // NetworkPluginMaxConfNum is the max number of plugin config file will load + // NetworkPluginMaxConfNum is the max number of plugin config files that will + // be loaded from the cni config directory by go-cni. Set the value to 0 to + // load all config files (no arbitrary limit). The legacy default value is 1. NetworkPluginMaxConfNum int `toml:"max_conf_num" json:"maxConfNum"` // NetworkPluginConfTemplate is the file path of golang template used to generate // cni config. @@ -204,7 +206,7 @@ func DefaultConfig() PluginConfig { CniConfig: CniConfig{ NetworkPluginBinDir: "/opt/cni/bin", NetworkPluginConfDir: "/etc/cni/net.d", - NetworkPluginMaxConfNum: 1, + NetworkPluginMaxConfNum: 1, // only one CNI plugin config file will be loaded NetworkPluginConfTemplate: "", }, ContainerdConfig: ContainerdConfig{