mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 05:57:25 +00:00
cni: print better error when a CNI .configlist is put into a .config
This commit is contained in:
parent
6430b1002c
commit
c19965c740
@ -119,6 +119,13 @@ func getDefaultCNINetwork(pluginDir, binDir, vendorCNIDirPrefix string) (*cniNet
|
|||||||
glog.Warningf("Error loading CNI config file %s: %v", confFile, err)
|
glog.Warningf("Error loading CNI config file %s: %v", confFile, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
// Ensure the config has a "type" so we know what plugin to run.
|
||||||
|
// Also catches the case where somebody put a conflist into a conf file.
|
||||||
|
if conf.Network.Type == "" {
|
||||||
|
glog.Warningf("Error loading CNI config file %s: no 'type'; perhaps this is a .conflist?", confFile)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
confList, err = libcni.ConfListFromConf(conf)
|
confList, err = libcni.ConfListFromConf(conf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Warningf("Error converting CNI config file %s to list: %v", confFile, err)
|
glog.Warningf("Error converting CNI config file %s to list: %v", confFile, err)
|
||||||
|
Loading…
Reference in New Issue
Block a user