diff --git a/multus/multus.go b/multus/multus.go index d96ead5a7..ecd968ff2 100644 --- a/multus/multus.go +++ b/multus/multus.go @@ -58,6 +58,10 @@ func loadNetConf(bytes []byte) (*types.NetConf, error) { defaultcninetwork = true } + if netconf.CNIDir == "" { + netconf.CNIDir = defaultCNIDir + } + if netconf.UseDefault { if netconf.Kubeconfig == "" || !defaultcninetwork { return nil, fmt.Errorf(`If you have set always_use_default, you must also set the delegates & the kubeconfig, refer to the README`) @@ -73,10 +77,6 @@ func loadNetConf(bytes []byte) (*types.NetConf, error) { return nil, fmt.Errorf(`delegates or kubeconfig option is must, refer README.md`) } - if netconf.CNIDir == "" { - netconf.CNIDir = defaultCNIDir - } - return netconf, nil }